Rework module parsing and execution (#4462)
This patch disables automatic detection of module code, and instead requires the user to explicitly specify whether to parse a source as a module or as a script. To achieve this the jerry_parse API function now takes a new option which signals that the source should be parsed as a module. JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
This commit is contained in:
@@ -16,14 +16,16 @@
|
||||
#include "config.h"
|
||||
#include "ecma-helpers.h"
|
||||
#include "lit-char-helpers.h"
|
||||
#include "lit-unicode-ranges.inc.h"
|
||||
#include "lit-unicode-ranges-sup.inc.h"
|
||||
#include "lit-strings.h"
|
||||
#include "lit-unicode-ranges.inc.h"
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#include "lit-unicode-ranges-sup.inc.h"
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_UNICODE_CASE_CONVERSION)
|
||||
#include "lit-unicode-conversions.inc.h"
|
||||
#include "lit-unicode-conversions-sup.inc.h"
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#include "lit-unicode-conversions-sup.inc.h"
|
||||
#include "lit-unicode-folding.inc.h"
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* ENABLED (JERRY_UNICODE_CASE_CONVERSION) */
|
||||
|
||||
@@ -549,6 +549,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DATAVIEW_UL, "DataView")
|
||||
#endif
|
||||
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_UL, "Function")
|
||||
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INFINITY_UL, "Infinity")
|
||||
#if ENABLED (JERRY_MODULE_SYSTEM)
|
||||
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RUNNABLE_UL, "Runnable")
|
||||
#endif
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_URI_ERROR_UL, "URIError")
|
||||
#endif
|
||||
|
||||
@@ -214,6 +214,7 @@ LIT_MAGIC_STRING_VALUE_OF_UL = "valueOf"
|
||||
LIT_MAGIC_STRING_WEAKMAP_UL = "WeakMap"
|
||||
LIT_MAGIC_STRING_WEAKSET_UL = "WeakSet"
|
||||
LIT_MAGIC_STRING_EPSILON_U = "EPSILON"
|
||||
LIT_MAGIC_STRING_RUNNABLE_UL = "Runnable"
|
||||
LIT_MAGIC_STRING_DATAVIEW_UL = "DataView"
|
||||
LIT_MAGIC_STRING_FUNCTION_UL = "Function"
|
||||
LIT_MAGIC_STRING_INFINITY_UL = "Infinity"
|
||||
|
||||
Reference in New Issue
Block a user