aboutsummaryrefslogtreecommitdiff
path: root/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
diff options
context:
space:
mode:
authorAkos Kiss <akiss@inf.u-szeged.hu>2017-03-23 09:36:29 +0100
committerGitHub <noreply@github.com>2017-03-23 09:36:29 +0100
commit4a5df52aa1831d6481f9679f6428ee5ebcca787d (patch)
treec0928c1ae64edc9f5b65b43b1fb74e7464d1c85b /jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
parent852a6aef53cc379c2b5961363d4a1b1a5a671c42 (diff)
Factor out common macro un/definitions used for built-in descriptions (#1678)
The default definitions and undefinitions of macros used for built-in descriptions (SIMPLE_VALUE, NUMBER_VALUE, STRING_VALUE, OBJECT_VALUE, ROUTINE, ACCESSOR_READ_WRITE, ACCESSOR_READ_ONLY) are heavily cloned all over the builtin-objects directory. This commit factors them out into two header files, which are then included in the place of the clones. This way, maintenance becomes a lot easier: e.g., if a new macro gets introduced, default definition and undefinition don't have to be added to all description files (of which there are 56 right now, and their number will most probably just grow). JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Diffstat (limited to 'jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h')
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
index 7d5de679..8de27d42 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
@@ -16,17 +16,8 @@
/*
* Object built-in description
*/
-#ifndef NUMBER_VALUE
-# define NUMBER_VALUE(name, number_value, prop_attributes)
-#endif /* !NUMBER_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 */
+#include "ecma-builtin-helpers-macro-defines.inc.h"
/* Number properties:
* (property name, number value, writable, enumerable, configurable) */
@@ -64,10 +55,4 @@ ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTY_UL, ecma_builtin_object_object_define_
ROUTINE (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, ecma_builtin_object_object_set_prototype_of, 2, 2)
#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
-#undef SIMPLE_VALUE
-#undef NUMBER_VALUE
-#undef STRING_VALUE
-#undef OBJECT_VALUE
-#undef ROUTINE
-#undef ACCESSOR_READ_WRITE
-#undef ACCESSOR_READ_ONLY
+#include "ecma-builtin-helpers-macro-undefs.inc.h"