diff --git a/BUILD.gn b/BUILD.gn index dbf364a1fc92c1daf0b735995be59294be78c1fe..8d929a0d040d106f77504ce35b7276eec3b0e6a3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -35,6 +35,7 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera "JERRY_HEAPDUMP", "JERRY_REF_TRACKER", ] + defines += es6_support_defines cflags = [ "-Wno-unused-function", "-Wno-sign-compare", @@ -47,7 +48,6 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera defines = [ "JERRY_CPOINTER_32_BIT=0", "JERRY_DEBUGGER=1", - "JERRY_ES2015=0", "JERRY_FUNCTION_BACKTRACE", "JERRY_FUNCTION_NAME", "JERRY_GC_LIMIT=(0)", @@ -65,6 +65,7 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera "JERRY_VALGRIND=0", "JERRY_VM_EXEC_STOP=0", ] + defines += es6_support_defines if (thirdparty_jerryscript_enable_external_context == true) { defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] } diff --git a/engine.gni b/engine.gni index e1d67c961f8b2f2025f6cc89fbcb69bf13fd5606..420aa27a70ae3fd2a9b4b490c8d8d736c3c970b5 100644 --- a/engine.gni +++ b/engine.gni @@ -26,3 +26,18 @@ ext_path = "${engine_path}/jerry-ext" libm_path = "${engine_path}/jerry-libm" port_path = "${engine_path}/jerry-port" + +# support es6 with limitation +es6_support_defines = [ + "JERRY_ES2015=1", + "JERRY_ES2015_BUILTIN_TYPEDARRAY=1", + "JERRY_ES2015_BUILTIN_SET=1", + "JERRY_ES2015_BUILTIN_PROMISE=1", + "JERRY_ES2015_BUILTIN_PROXY=1", + "JERRY_ES2015_MODULE_SYSTEM=1", + "JERRY_ES2015_BUILTIN_MAP=1", + "JERRY_ES2015_BUILTIN_WEAKMAP=0", + "JERRY_ES2015_BUILTIN_WEAKSET=0", + "JERRY_ES2015_BUILTIN_DATAVIEW=0", + "JERRY_ES2015_BUILTIN_REFLECT=0", +] diff --git a/jerry-core/BUILD.gn b/jerry-core/BUILD.gn index 454ff955e44308f68662e09ad72860707da93542..fbabc70de6647c050ab979a3abc87d930ab15dd8 100644 --- a/jerry-core/BUILD.gn +++ b/jerry-core/BUILD.gn @@ -223,6 +223,7 @@ if (board_toolchain_type != "iccarm") { "JERRY_FUNCTION_BACKTRACE", "JERRY_STACK_LIMIT=0", ] + jerry_core_defines += es6_support_defines } else { jerry_core_sources += [ "api/external-context-helpers.c", @@ -245,7 +246,6 @@ if (board_toolchain_type != "iccarm") { "JERRY_DEBUGGER=0", "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0", "JERRY_PARSER_DUMP_BYTE_CODE=0", - "JERRY_ES2015=0", "JERRY_REGEXP_STRICT_MODE=0", "JERRY_REGEXP_DUMP_BYTE_CODE=0", "JERRY_SNAPSHOT_EXEC=1", @@ -259,6 +259,7 @@ if (board_toolchain_type != "iccarm") { "SNAPSHOT_BUFFER_SIZE=48*1024", "_BSD_SOURCE", ] + defines += es6_support_defines if (thirdparty_jerryscript_enable_external_context == true) { defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] } diff --git a/jerry-core/config.h b/jerry-core/config.h index a70b15923f7301ffe0a04718101d81c4b7840d23..ebde3dbb372a932fbc093a78ae6e9151a1b3b6d8 100644 --- a/jerry-core/config.h +++ b/jerry-core/config.h @@ -83,23 +83,55 @@ #ifdef JERRY_FOR_IAR_CONFIG # error "Should not define this macro on WIN simulator!" #endif +#ifndef JERRY_BUILTIN_REGEXP # define JERRY_BUILTIN_REGEXP 0 +#endif + +#ifndef JERRY_ES2015 # define JERRY_ES2015 0 +#endif + +#ifndef JERRY_ES2015_BUILTIN_TYPEDARRAY # define JERRY_ES2015_BUILTIN_TYPEDARRAY 1 +#endif + //Maximum size of heap in kilobytes +#ifndef JERRY_GLOBAL_HEAP_SIZE # define JERRY_GLOBAL_HEAP_SIZE (64) +#endif + +#ifndef JERRY_DISABLE_HEAVY_DEBUG # define JERRY_DISABLE_HEAVY_DEBUG +#endif + +#ifndef JERRY_ERROR_MESSAGES # define JERRY_ERROR_MESSAGES 1 +#endif + +#ifndef JERRY_LINE_INFO # define JERRY_LINE_INFO 1 +#endif + +#ifndef JERRY_MEM_STATS # define JERRY_MEM_STATS 1 +#endif + +#ifndef JERRY_SNAPSHOT_EXEC # define JERRY_SNAPSHOT_EXEC 1 +#endif + +#ifndef JERRY_SNAPSHOT_SAVE # define JERRY_SNAPSHOT_SAVE 1 +#endif + #ifndef JERRY_LOGGING # define JERRY_LOGGING 1 #endif // following config controls temp changes in jerry for debugger function with IDE +#ifndef ACE_DEBUGGER_CUSTOM # define ACE_DEBUGGER_CUSTOM +#endif #ifndef JERRY_BUILTIN_EVAL_DISABLED // disable builtin eval() function diff --git a/jerry-ext/BUILD.gn b/jerry-ext/BUILD.gn index c9926dcbea2726b7aee1ea9013d638a89bafeda3..0d289df887365a584fb679f44a8339dbd2e791eb 100644 --- a/jerry-ext/BUILD.gn +++ b/jerry-ext/BUILD.gn @@ -68,7 +68,6 @@ if (board_toolchain_type == "iccarm") { "JERRY_DEBUGGER=0", "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0", "JERRY_PARSER_DUMP_BYTE_CODE=0", - "JERRY_ES2015=0", "JERRY_REGEXP_STRICT_MODE=0", "JERRY_REGEXP_DUMP_BYTE_CODE=0", "JERRY_SNAPSHOT_EXEC=1", @@ -81,6 +80,7 @@ if (board_toolchain_type == "iccarm") { "INPUTJS_BUFFER_SIZE=64*1024", "SNAPSHOT_BUFFER_SIZE=48*1024", ] + defines += es6_support_defines if (thirdparty_jerryscript_enable_external_context == true) { defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] } diff --git a/jerry-port/default/BUILD.gn b/jerry-port/default/BUILD.gn index d2c46713496dc538f0d9f3ec18aace191df76d28..12b7bf77844f480792c42992bfb7129679c20c35 100644 --- a/jerry-port/default/BUILD.gn +++ b/jerry-port/default/BUILD.gn @@ -53,7 +53,6 @@ if (board_toolchain_type == "iccarm") { "JERRY_DEBUGGER=0", "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0", "JERRY_PARSER_DUMP_BYTE_CODE=0", - "JERRY_ES2015=0", "JERRY_REGEXP_STRICT_MODE=0", "JERRY_REGEXP_DUMP_BYTE_CODE=0", "JERRY_SNAPSHOT_EXEC=1", @@ -66,6 +65,7 @@ if (board_toolchain_type == "iccarm") { "INPUTJS_BUFFER_SIZE=64*1024", "SNAPSHOT_BUFFER_SIZE=48*1024", ] + defines += es6_support_defines if (thirdparty_jerryscript_enable_external_context == true) { defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] }