aboutsummaryrefslogtreecommitdiff
path: root/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
diff options
context:
space:
mode:
authorAkos Kiss <akiss@inf.u-szeged.hu>2017-04-21 11:42:36 +0200
committerGitHub <noreply@github.com>2017-04-21 11:42:36 +0200
commit67c641e567dc48cc40f431cb12b45cb2205ad71e (patch)
tree899bd14c5f89820c5982de404a4a4d96ba390cea /jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
parent5231829fc9383be888f06d1cb435d393490e158a (diff)
Generate lit-magic-strings.inc.h (#1690)
Currently, `lit-magic-strings.inc.h` is manually maintained. This has several drawbacks: - keeping the list of magic strings sorted first by length then alphabetically is error prone, - it is easy to leave unused magic strings in the list by accident (e.g., `LIT_MAGIC_STRING_JERRY_UL` is defined as a magic string but not used anywhere in the code) and, - it is very hard to add `CONFIG_DISABLE_*_BUILTIN` guards to the list, even though there are several magic strings, which are used in some of the configurations only (e.g, "setPrototypeOf" is used in ES2015 only). To ease the maintenance of magic strings, this commit moves the definition of magic strings to a config file (`lit-magic-strings.ini`), and adds `tools/gen-magic-strings.py` to generate the `.inc.h` file from this config file and from the use cases of the strings in the code. - The magic strings in the config file can appear in any order, the generator will ensure that they are correctly sorted. - The generator skips those definitions that are not used anywhere (and emits a warning to signal that such definitions can be removed). - The generator applies the same guards to the definitions in the `.inc.h` file as found in the code around the use of the strings to optimize for size. The commit also changes some builtin-related `.inc.h` files by adding guards that don't affect functionality but improve the results of the generator. To ensure that the invocation of the generator does not get forgotten, the commit also adds `tools/check-magic-strings.sh` and binds it into the testing infrastructure. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Diffstat (limited to 'jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h')
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
index 30a43e1d..32c10ab5 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
@@ -19,6 +19,8 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
/* Number properties:
* (property name, number value, writable, enumerable, configurable) */
@@ -35,4 +37,6 @@ 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"