Implement WeakMap and WeakSet (#3328)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
committed by
Robert Fancsik
parent
830011c033
commit
bd0cb33172
@@ -99,6 +99,14 @@
|
||||
# define JERRY_ES2015_BUILTIN_SET JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_SET) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_WEAKMAP
|
||||
# define JERRY_ES2015_BUILTIN_WEAKMAP JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_WEAKMAP) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_WEAKSET
|
||||
# define JERRY_ES2015_BUILTIN_WEAKSET JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_WEAKSET) */
|
||||
|
||||
#ifndef JERRY_ES2015_BUILTIN_PROMISE
|
||||
# define JERRY_ES2015_BUILTIN_PROMISE JERRY_ES2015
|
||||
#endif /* !defined (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
@@ -540,6 +548,14 @@
|
||||
|| ((JERRY_ES2015_BUILTIN_SET != 0) && (JERRY_ES2015_BUILTIN_SET != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_SET macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_WEAKMAP) \
|
||||
|| ((JERRY_ES2015_BUILTIN_WEAKMAP != 0) && (JERRY_ES2015_BUILTIN_WEAKMAP != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_WEAKMAP macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_WEAKSET) \
|
||||
|| ((JERRY_ES2015_BUILTIN_WEAKSET != 0) && (JERRY_ES2015_BUILTIN_WEAKSET != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_WEAKSET macro."
|
||||
#endif
|
||||
#if !defined (JERRY_ES2015_BUILTIN_PROMISE) \
|
||||
|| ((JERRY_ES2015_BUILTIN_PROMISE != 0) && (JERRY_ES2015_BUILTIN_PROMISE != 1))
|
||||
# error "Invalid value for JERRY_ES2015_BUILTIN_PROMISE macro."
|
||||
@@ -668,4 +684,14 @@
|
||||
# error "Date does not support float32"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Wrap container types into a single guard
|
||||
*/
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) \
|
||||
|| ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
|
||||
# define JERRY_ES2015_BUILTIN_CONTAINER 1
|
||||
#else
|
||||
# define JERRY_ES2015_BUILTIN_CONTAINER 0
|
||||
#endif
|
||||
|
||||
#endif /* !JERRYSCRIPT_CONFIG_H */
|
||||
|
||||
Reference in New Issue
Block a user