diff options
author | Szilagyi Adam <aszilagy@inf.u-szeged.hu> | 2022-01-31 16:46:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-31 16:46:00 +0100 |
commit | 4924f9fd315e9281a89d0621f278f3a6c1c7efd2 (patch) | |
tree | e2fbdc0652209d62c696067bf239e5bfe5fae916 /jerry-core/ecma | |
parent | 76403606d08adb53023f7093c90ce2070a0e28fb (diff) |
Remove ES_NEXT macro (#4915)
- remove all '#JERRY_ESNEXT' macro
- remove 5.1 build profile, update test runner accordingly (Note: all builtins are turn on by default)
- move tests from tests/jerry/esnext into tests/jerry, concatenate files with same names
- add skiplist to some snapshot tests that were supported only in 5.1
- fix doxygen issues that were hidden before (bc. of es.next macro)
Co-authored-by: Martin Negyokru negyokru@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
Diffstat (limited to 'jerry-core/ecma')
155 files changed, 264 insertions, 2437 deletions
diff --git a/jerry-core/ecma/base/ecma-error-messages.inc.h b/jerry-core/ecma/base/ecma-error-messages.inc.h index b131911a..7711f871 100644 --- a/jerry-core/ecma/base/ecma-error-messages.inc.h +++ b/jerry-core/ecma/base/ecma-error-messages.inc.h @@ -36,12 +36,10 @@ ECMA_ERROR_DEF (ECMA_ERR_INVALID_ENCODING, "Invalid encoding") ECMA_ERROR_DEF (ECMA_ERR_NOTHING_TO_REPEAT, "Nothing to repeat") #endif /* JERRY_BUILTIN_REGEXP */ ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_AN_OBJECT, "Expected an object") -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_INVALID_CAPABILITY, "Invalid capability") -#endif /* JERRY_ESNEXT */ -#if JERRY_BUILTIN_STRING && JERRY_ESNEXT +#if JERRY_BUILTIN_STRING ECMA_ERROR_DEF (ECMA_ERR_INVALID_CODE_POINT, "Invalid code point") -#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_STRING */ #if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_INVALID_QUANTIFIER, "Invalid quantifier") #endif /* JERRY_BUILTIN_REGEXP */ @@ -56,9 +54,9 @@ ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_A_FUNCTION, "Expected a function") ECMA_ERROR_DEF (ECMA_ERR_INVALID_JSON_FORMAT, "Invalid JSON format") #endif /* JERRY_BUILTIN_JSON */ ECMA_ERROR_DEF (ECMA_ERR_INVALID_UTF8_STRING, "Invalid UTF8 string") -#if JERRY_BUILTIN_STRING && JERRY_ESNEXT +#if JERRY_BUILTIN_STRING ECMA_ERROR_DEF (ECMA_ERR_INVALID_COUNT_VALUE, "Invalid count value") -#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_STRING */ #if !(JERRY_BUILTIN_REALMS) ECMA_ERROR_DEF (ECMA_ERR_REALMS_ARE_DISABLED, "Realms are disabled") #endif /* !(JERRY_BUILTIN_REALMS) */ @@ -80,9 +78,9 @@ ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_OBJECT, "Target is not Object") ECMA_ERROR_DEF (ECMA_ERR_BIGINT_VALUE_EXCPECTED, "BigInt value expected") #endif /* JERRY_BUILTIN_BIGINT */ ECMA_ERROR_DEF (ECMA_ERR_BINDING_CANNOT_SET, "Binding cannot be set") -#if JERRY_BUILTIN_STRING && JERRY_ESNEXT +#if JERRY_BUILTIN_STRING ECMA_ERROR_DEF (ECMA_ERR_INVALID_STRING_, "Invalid string length") -#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_STRING */ #if JERRY_BUILTIN_CONTAINER ECMA_ERROR_DEF (ECMA_ERR_KEY_MUST_BE_AN_OBJECT, "Key must be an object") #endif /* JERRY_BUILTIN_CONTAINER */ @@ -95,9 +93,9 @@ ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_WEAKREF, "Target is not weakRef") #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE, "Target not extensible") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB +#if JERRY_BUILTIN_ANNEXB ECMA_ERROR_DEF (ECMA_ERR_GETTER_IS_NOT_CALLABLE, "Getter is not callable") -#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */ +#endif /* JERRY_BUILTIN_ANNEXB */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_HANDLER_CANNOT_BE_NULL, "Handler cannot be null") #endif /* JERRY_BUILTIN_PROXY */ @@ -119,19 +117,19 @@ ECMA_ERROR_DEF (ECMA_ERR_REALM_IS_NOT_AVAILABLE, "Realm is not available") ECMA_ERROR_DEF (ECMA_ERR_BIGINT_ZERO_DIVISION, "BigInt division by zero") #endif /* JERRY_BUILTIN_BIGINT */ ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_AN_ARRAYBUFFER, "Expected an ArrayBuffer") -#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT +#if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_INVALID_CHARACTER_CLASS, "Invalid character class") ECMA_ERROR_DEF (ECMA_ERR_INVALID_ESCAPE_SEQUENCE, "Invalid escape sequence") -#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_REGEXP */ #if JERRY_SNAPSHOT_EXEC ECMA_ERROR_DEF (ECMA_ERR_INVALID_SNAPSHOT_FORMAT, "Invalid snapshot format") #endif /* JERRY_SNAPSHOT_EXEC */ #if JERRY_BUILTIN_JSON ECMA_ERROR_DEF (ECMA_ERR_JSON_STRING_PARSE_ERROR, "JSON string parse error") #endif /* JERRY_BUILTIN_JSON */ -#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT +#if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_LONE_QUANTIFIER_BRACKET, "Lone quantifier bracket") -#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_REGEXP */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_OBJECT_CANNOT_BE_FROZEN, "Object cannot be frozen") ECMA_ERROR_DEF (ECMA_ERR_OBJECT_CANNOT_BE_SEALED, "Object cannot be sealed") @@ -145,24 +143,18 @@ ECMA_ERROR_DEF (ECMA_ERR_UNMATCHED_CLOSE_BRACKET, "Unmatched close bracket") #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_NOT_MODULE, "Argument is not a module") #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_SET_PROTOTYPE, "Cannot set [[Prototype]]") -#endif /* JERRY_ESNEXT */ -#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT +#if JERRY_BUILTIN_ARRAY ECMA_ERROR_DEF (ECMA_ERR_INVALID_NEW_ARRAY_LENGTH, "Invalid new Array length") -#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */ -#if JERRY_ESNEXT +#endif /* JERRY_BUILTIN_ARRAY */ ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_IS_NOT_CALLABLE, "Iterator is not callable") -#endif /* JERRY_ESNEXT */ #if !(JERRY_BUILTIN_JSON) ECMA_ERROR_DEF (ECMA_ERR_JSON_NOT_SUPPORTED, "JSON support is disabled") #endif /* !(JERRY_BUILTIN_JSON) */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_MODULE_IS_IN_ERROR_STATE, "Module is in error state") #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_REJECT_MUST_BE_UNDEFINED, "Reject must be undefined") -#endif /* JERRY_ESNEXT */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_REQUEST_IS_NOT_AVAILABLE, "Request is not available") #endif /* JERRY_MODULE_SYSTEM */ @@ -170,17 +162,15 @@ ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT, "Argument is not an object") #if JERRY_BUILTIN_ATOMICS ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_NOT_SUPPORTED, "Argument is not supported") #endif /* JERRY_BUILTIN_ATOMICS */ -#if JERRY_BUILTIN_STRING && JERRY_ESNEXT +#if JERRY_BUILTIN_STRING ECMA_ERROR_DEF (ECMA_ERR_INVALID_CODE_POINT_ERROR, "Error: Invalid code point") -#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_STRING */ #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_INVALID_TYPEDARRAY_LENGTH, "Invalid TypedArray length") #endif /* JERRY_BUILTIN_TYPEDARRAY */ ECMA_ERROR_DEF (ECMA_ERR_INVALID_HEXADECIMAL_VALUE, "Invalid hexadecimal value") -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_IS_NOT_AN_OBJECT, "Iterator is not an object") ECMA_ERROR_DEF (ECMA_ERR_RESOLVE_MUST_BE_UNDEFINED, "Resolve must be undefined") -#endif /* JERRY_ESNEXT */ #if JERRY_SNAPSHOT_SAVE ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_BUFFER_SMALL, "Snapshot buffer too small") #endif /* JERRY_SNAPSHOT_SAVE */ @@ -209,37 +199,22 @@ ECMA_ERROR_DEF (ECMA_ERR_MODULE_NOT_SUPPORTED, "Module support is disabled") #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_OBJECT_IS_NOT_A_TYPEDARRAY, "Object is not a TypedArray") #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_RECEIVER_MUST_BE_AN_OBJECT, "Receiver must be an object") -#endif /* JERRY_ESNEXT */ -#if !(JERRY_ESNEXT) -ECMA_ERROR_DEF (ECMA_ERR_SYMBOL_NOT_SUPPORTED, "Symbol support is disabled") -#endif /* !(JERRY_ESNEXT) */ #if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_JSON ECMA_ERROR_DEF (ECMA_ERR_BIGINT_SERIALIZED, "BigInt cannot be serialized") #endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_JSON */ #if JERRY_BUILTIN_CONTAINER ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_IS_NOT_AN_OBJECT, "Container is not an object.") #endif /* JERRY_BUILTIN_CONTAINER */ -#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT +#if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_INVALID_HEX_ESCAPE_SEQUENCE, "Invalid hex escape sequence") -#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */ -#if JERRY_ESNEXT +#endif /* JERRY_BUILTIN_REGEXP */ ECMA_ERROR_DEF (ECMA_ERR_INVALID_SPECIES_CONSTRUCTOR, "Invalid species constructor") -#endif /* JERRY_ESNEXT */ -#if !(JERRY_ESNEXT) -ECMA_ERROR_DEF (ECMA_ERR_PROMISE_NOT_SUPPORTED, "Promise support is disabled") -#endif /* !(JERRY_ESNEXT) */ -#if JERRY_BUILTIN_PROXY || JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_PROXY_TRAP_RETURNED_FALSISH, "Proxy trap returned falsish") -#endif /* JERRY_BUILTIN_PROXY \ -|| JERRY_ESNEXT */ #if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_MIN_GREATER_THAN_MAX, "Quantifier error: min > max") #endif /* JERRY_BUILTIN_REGEXP */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_SYMBOL_IS_NOT_A_CONSTRUCTOR, "Symbol is not a constructor") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_REFLECT ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_A_CONSTRUCTOR, "Target is not a constructor") #endif /* JERRY_BUILTIN_REFLECT */ @@ -250,21 +225,13 @@ ECMA_ERROR_DEF (ECMA_ERR_DATA_VIEW_NOT_SUPPORTED, "DataView support is disabled" #if JERRY_BUILTIN_DATE ECMA_ERROR_DEF (ECMA_ERR_DATE_MUST_BE_A_FINITE_NUMBER, "Date must be a finite number") #endif /* JERRY_BUILTIN_DATE */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_LOCAL_VARIABLE_IS_REDECLARED, "Local variable is redeclared") -#endif /* JERRY_ESNEXT */ ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_BINARY_OPERATION, "Unsupported binary operation") #if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_UNTERMINATED_CHARACTER_CLASS, "Unterminated character class") #endif /* JERRY_BUILTIN_REGEXP */ -#if JERRY_BUILTIN_DATAVIEW || JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_ARRAYBUFFER_IS_DETACHED, "ArrayBuffer has been detached") -#endif /* JERRY_BUILTIN_DATAVIEW \ -|| JERRY_BUILTIN_TYPEDARRAY \ -|| JERRY_ESNEXT */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_NOT_AN_OBJECT, "Constructor must be an object") -#endif /* JERRY_ESNEXT */ #if !(JERRY_BUILTIN_CONTAINER) ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_NOT_SUPPORTED, "Container support is disabled") #endif /* !(JERRY_BUILTIN_CONTAINER) */ @@ -277,18 +244,14 @@ ECMA_ERROR_DEF (ECMA_ERR_INCOMPATIBLE_TYPEDARRAY_TYPES, "Incompatible TypedArray #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_TYPE_FOR_TYPEDARRAY, "Incorrect type for TypedArray") #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_INVALID_OR_OUT_OF_RANGE_INDEX, "Invalid or out-of-range index") -#endif /* JERRY_ESNEXT */ #if JERRY_SNAPSHOT_SAVE ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_SNAPSHOT_SIZE, "Maximum snapshot size reached") #endif /* JERRY_SNAPSHOT_SAVE */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_MODULE_CANNOT_BE_INSTANTIATED, "Module cannot be instantiated") #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_SPECIES_MUST_BE_A_CONSTRUCTOR, "Species must be a constructor") -#endif /* JERRY_ESNEXT */ ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_A_PROXY, "Argument is not a Proxy object") #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_NOT_ARRAY_BUFFER, "Argument is not an ArrayBuffer") @@ -302,9 +265,7 @@ ECMA_ERROR_DEF (ECMA_ERR_MODULE_MUST_BE_IN_LINKED_STATE, "Module must be in link ECMA_ERROR_DEF (ECMA_ERR_UNKNOWN_EXPORT, "Native module export not found") #endif /* JERRY_MODULE_SYSTEM */ ECMA_ERROR_DEF (ECMA_ERR_PASSED_ARGUMENT_IS_NOT_A_REALM, "Passed argument is not a realm") -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_PRIVATE_METHOD_IS_NOT_WRITABLE, "Private method is not writable") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT || JERRY_BUILTIN_NUMBER ECMA_ERROR_DEF (ECMA_ERR_RADIX_IS_OUT_OF_RANGE, "Radix must be between 2 and 36") #endif /* JERRY_BUILTIN_BIGINT \ @@ -316,15 +277,13 @@ ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_EXEC_DISABLED, "Snapshot execution is disabled ECMA_ERROR_DEF (ECMA_ERR_TYPED_ARRAY_NOT_SUPPORTED, "TypedArray support is disabled") #endif /* !(JERRY_BUILTIN_TYPEDARRAY) */ ECMA_ERROR_DEF (ECMA_ERR_UNICODE_SURROGATE_PAIR_MISSING, "Unicode surrogate pair missing") -#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT +#if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_INVALID_CONTROL_ESCAPE_SEQUENCE, "Invalid control escape sequence") ECMA_ERROR_DEF (ECMA_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE, "Invalid unicode escape sequence") -#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */ -#if JERRY_ESNEXT +#endif /* JERRY_BUILTIN_REGEXP */ ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_NEXT_IS_NOT_CALLABLE, "Iterator 'next' is not callable") ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_VALUE_IS_NOT_AN_OBJECT, "Iterator value is not an object") ECMA_ERROR_DEF (ECMA_ERR_RESOLVE_METHOD_MUST_BE_CALLABLE, "Resolve method must be callable") -#endif /* JERRY_ESNEXT */ #if !(JERRY_SNAPSHOT_SAVE) ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_SAVE_DISABLED, "Snapshot generation is disabled") #endif /* !(JERRY_SNAPSHOT_SAVE) */ @@ -337,20 +296,14 @@ ECMA_ERROR_DEF (ECMA_ERR_TRAP_MUST_RETURN_WITH_AN_OBJECT, "Trap must return with #if JERRY_BUILTIN_CONTAINER ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_CONTAINER_OPERATION, "Unsupported container operation") #endif /* JERRY_BUILTIN_CONTAINER */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_METHOD_RETURN_IS_NOT_CALLABLE, "method 'return' is not callable") ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_PROMISE, "Argument 'this' is not a Promise") -#endif /* JERRY_ESNEXT */ ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT, "Argument 'this' is not an object") -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SYMBOL, "Argument 'this' must be a Symbol") -#endif /* JERRY_ESNEXT */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_CALLBACK_RESULT_NOT_MODULE, "Callback result must be a module") #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CLASS_CONSTRUCTOR_REQUIRES_NEW, "Class constructor requires 'new'") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_ARRAY ECMA_ERROR_DEF (ECMA_ERR_COMPARE_FUNC_NOT_CALLABLE, "Compare function is not callable") #endif /* JERRY_BUILTIN_ARRAY */ @@ -358,21 +311,15 @@ ECMA_ERROR_DEF (ECMA_ERR_COMPARE_FUNC_NOT_CALLABLE, "Compare function is not cal ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_PROXY_REQUIRES_NEW, "Constructor Proxy requires 'new'") #endif /* JERRY_BUILTIN_PROXY */ ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_A_CONFIGURABLE_PROPERTY, "Expected a configurable property") -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_FIRST_PARAMETER_MUST_BE_CALLABLE, "First parameter must be callable") -#endif /* JERRY_ESNEXT */ -#if JERRY_BUILTIN_CONTAINER && JERRY_ESNEXT +#if JERRY_BUILTIN_CONTAINER ECMA_ERROR_DEF (ECMA_ERR_FUNCTION_ADD_ORSET_IS_NOT_CALLABLE, "Function add/set is not callable") -#endif /* JERRY_BUILTIN_CONTAINER && JERRY_ESNEXT */ -#if JERRY_ESNEXT +#endif /* JERRY_BUILTIN_CONTAINER */ ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_RESULT_IS_NOT_AN_OBJECT, "Iterator result is not an object") -#endif /* JERRY_ESNEXT */ #if (JERRY_STACK_LIMIT != 0) ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_CALL_STACK_SIZE_EXCEEDED, "Maximum call stack size exceeded") #endif /* (JERRY_STACK_LIMIT != 0) */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_STRING_LENGTH_IS_REACHED, "Maximum string length is reached") -#endif /* JERRY_ESNEXT */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_MODULE_MUST_BE_IN_UNLINKED_STATE, "Module must be in unlinked state") #endif /* JERRY_MODULE_SYSTEM */ @@ -398,9 +345,7 @@ ECMA_ERROR_DEF (ECMA_ERR_INITIAL_VALUE_CANNOT_BE_UNDEFINED, "Initial value canno ECMA_ERROR_DEF (ECMA_ERR_INVALID_SHARED_ARRAYBUFFER_LENGTH, "Invalid Shared ArrayBuffer length") #endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */ ECMA_ERROR_DEF (ECMA_ERR_INVALID_TYPE_FOR_CONSTRUCTOR_CALL, "Invalid type for constructor call") -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_THROW_IS_NOT_AVAILABLE, "Iterator 'throw' is not available") -#endif /* JERRY_ESNEXT */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_NAMESPACE_OBJECT_IS_NOT_AVAILABLE, "Namespace object is not available") #endif /* JERRY_MODULE_SYSTEM */ @@ -413,13 +358,9 @@ ECMA_ERROR_DEF (ECMA_ERR_SECOND_ARGUMENT_MUST_BE_AN_OBJECT, "Second argument mus #if JERRY_BUILTIN_DATAVIEW ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_BUFFER_NOT_OBJECT, "Argument 'buffer' is not an object") #endif /* JERRY_BUILTIN_DATAVIEW */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ITERATOR, "Argument 'this' is not an iterator") -#endif /* JERRY_ESNEXT */ ECMA_ERROR_DEF (ECMA_ERR_VALUE_MSG, "Argument cannot be marked as error") -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_PROMISE_REQUIRES_NEW, "Constructor Promise requires 'new'") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_CONTAINER ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKMAP_REQUIRES_NEW, "Constructor WeakMap requires 'new'") ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKSET_REQUIRES_NEW, "Constructor WeakSet requires 'new'") @@ -430,39 +371,30 @@ ECMA_ERROR_DEF (ECMA_ERR_INVALID_SCOPE_CHAIN_INDEX_FOR_EVAL, "Invalid scope chai #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_TYPEDARRAY_SIZE_IS_REACHED, "Maximum TypedArray size is reached") #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_THE_GIVEN_ARGUMENT_IS_NOT_A_SYMBOL, "The given argument is not a Symbol") ECMA_ERROR_DEF (ECMA_ERR_PARAMETER_REJECT_MUST_BE_CALLABLE, "'reject' parameter must be callable") -#endif /* JERRY_ESNEXT */ -#if JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT +#if JERRY_BUILTIN_ATOMICS || JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY, "Argument 'this' is not a TypedArray") -#endif /* JERRY_BUILTIN_TYPEDARRAY \ -|| JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_ATOMICS \ +|| JERRY_BUILTIN_TYPEDARRAY */ #if JERRY_SNAPSHOT_SAVE ECMA_ERROR_DEF (ECMA_ERR_CANNOT_ALLOCATE_MEMORY_LITERALS, "Cannot allocate memory for literals") #endif /* JERRY_SNAPSHOT_SAVE */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_INVOKE_NULLABLE_SUPER_METHOD, "Cannot invoke nullable super method") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_DATAVIEW ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_DATAVIEW_REQUIRES_NEW, "Constructor DataView requires 'new'") #endif /* JERRY_BUILTIN_DATAVIEW */ #if JERRY_BUILTIN_WEAKREF ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKREF_REQUIRES_NEW, "Constructor WeakRef requires 'new'.") #endif /* JERRY_BUILTIN_WEAKREF */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_SUPER_BINDING_MUST_BE_A_CONSTRUCTOR, "Super binding must be a constructor") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT ECMA_ERROR_DEF (ECMA_ERR_VALUE_CANNOT_BE_CONVERTED_TO_BIGINT, "Value cannot be converted to BigInt") #endif /* JERRY_BUILTIN_BIGINT */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_PARAMETER_RESOLVE_MUST_BE_CALLABLE, "'resolve' parameter must be callable") -#endif /* JERRY_ESNEXT */ -#if JERRY_BUILTIN_DATE || JERRY_ESNEXT +#if JERRY_BUILTIN_DATE ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_DATE_OBJECT, "Argument 'this' is not a Date object") -#endif /* JERRY_BUILTIN_DATE \ -|| JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_DATE */ #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_CONSTRUCTOR, "Argument 'this' is not a constructor") #endif /* JERRY_BUILTIN_TYPEDARRAY */ @@ -476,19 +408,16 @@ ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_INT8_ARRAY_REQUIRES_NEW, "Constructor Int8A #if JERRY_BUILTIN_CONTAINER ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_IS_NOT_A_CONTAINER_OBJECT, "Container is not a container object.") #endif /* JERRY_BUILTIN_CONTAINER */ -#if JERRY_BUILTIN_DATE && JERRY_ESNEXT +#if JERRY_BUILTIN_DATE ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE, "Invalid argument type in toPrimitive") -#endif /* JERRY_BUILTIN_DATE && JERRY_ESNEXT */ -#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT +#endif /* JERRY_BUILTIN_DATE */ +#if JERRY_ERROR_MESSAGES ECMA_ERROR_DEF (ECMA_ERR_METHODS_INVOKE_WITH_NEW, "Methods cannot be invoked with 'new'") -#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */ +#endif /* JERRY_ERROR_MESSAGES */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_MODULE_EXPORTS_MUST_BE_STRING_VALUES, "Module exports must be string values") #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_BUILTIN_REFLECT || JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_PROTOTYPE_IS_NEITHER_OBJECT_NOR_NULL, "Prototype is neither object nor null") -#endif /* JERRY_BUILTIN_REFLECT \ -|| JERRY_ESNEXT */ #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_THE_MAPFN_ARGUMENT_IS_NOT_CALLABLE, "The 'mapfn' argument is not callable") #endif /* JERRY_BUILTIN_TYPEDARRAY */ @@ -529,38 +458,26 @@ ECMA_ERROR_DEF (ECMA_ERR_TRAP_WITH_DUPLICATED_ENTRIES, "Trap returned with dupli #if JERRY_BUILTIN_BIGINT ECMA_ERROR_DEF (ECMA_ERR_UNARY_PLUS_IS_NOT_ALLOWED_FOR_BIGINTS, "Unary plus is not allowed for BigInts") #endif /* JERRY_BUILTIN_BIGINT */ -#if !JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP || JERRY_BUILTIN_REGEXP && JERRY_ESNEXT +#if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP, "Argument 'this' is not a RegExp object") -#endif /* !JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP \ -|| JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_REGEXP */ #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_ALLOCATE_ARRAY_BUFFER, "Cannot allocate memory for ArrayBuffer") #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CONSTANT_BINDINGS_CANNOT_BE_REASSIGNED, "Constant bindings cannot be reassigned") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_ARRAYBUFFER_REQUIRES_NEW, "Constructor ArrayBuffer requires 'new'") ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT16_ARRAY_REQUIRES_NEW, "Constructor Uint16Array requires 'new'") ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT32_ARRAY_REQUIRES_NEW, "Constructor Uint32Array requires 'new'") #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_GENERATOR_IS_CURRENTLY_UNDER_EXECUTION, "Generator is currently under execution") ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_RETURN_RESULT_IS_NOT_OBJECT, "Iterator 'return' result is not object") -#endif /* JERRY_ESNEXT */ -#if JERRY_BUILTIN_TYPEDARRAY -ECMA_ERROR_DEF (ECMA_ERR_RETURNED_ARRAYBUFFER_HAS_BEEN_DETACHED, "Returned ArrayBuffer has been detached") -#endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP, "Search string can't be of type: RegExp") ECMA_ERROR_DEF (ECMA_ERR_VALUE_RECEIVED_BY_YIELD_IS_NOT_OBJECT, "Value received by yield* is not object") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BOOLEAN ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_BOOLEAN_OBJECT, "Argument 'this' is not a Boolean object") #endif /* JERRY_BUILTIN_BOOLEAN */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CANNOT_DECLARE_SAME_PRIVATE_FIELD_TWICE, "Cannot declare same private field twice") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_FLOAT32_ARRAY_REQUIRES_NEW, "Constructor Float32Array requires 'new'") #endif /* JERRY_BUILTIN_TYPEDARRAY */ @@ -574,33 +491,27 @@ ECMA_ERROR_DEF (ECMA_ERR_IMPORTED_BINDING_SHADOWS_LOCAL_VARIABLE, "Imported bind #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_PROTOTYPE_FROM_REVOKED_PROXY_IS_INVALID, "Prototype from revoked Proxy is invalid") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING && JERRY_ESNEXT +#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING ECMA_ERROR_DEF (ECMA_ERR_REGEXP_ARGUMENT_SHOULD_HAVE_GLOBAL_FLAG, "RegExp argument should have global flag") -#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_TRAP_IS_NEITHER_AN_OBJECT_NOR_UNDEFINED, "Trap is neither an object nor undefined") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_PROMISE_RESOLVE_ITSELF, "A promise cannot be resolved with itself") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_BIGINT64_ARRAY_REQUIRES_NEW, "Constructor BigInt64Array requires 'new'") #endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_MODULE_EXPORTS_MUST_BE_VALID_IDENTIFIERS, "Module exports must be valid identifiers") #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_GENERATOR_OBJECT, "Argument 'this' is not a generator object") -#endif /* JERRY_ESNEXT */ ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_CANNOT_CONVERT_TO_OBJECT, "Argument cannot be converted to an object") #if JERRY_BUILTIN_BIGINT ECMA_ERROR_DEF (ECMA_ERR_ALLOCATE_BIGINT_VALUE, "Cannot allocate memory for a BigInt value") ECMA_ERROR_DEF (ECMA_ERR_CONVERT_BIGINT_TO_NUMBER, "Cannot convert a BigInt value to a number") #endif /* JERRY_BUILTIN_BIGINT */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CONVERT_SYMBOL_TO_NUMBER, "Cannot convert a Symbol value to a number") ECMA_ERROR_DEF (ECMA_ERR_CONVERT_SYMBOL_TO_STRING, "Cannot convert a Symbol value to a string") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_BIG_UINT64_ARRAY_REQUIRES_NEW, "Constructor BigUInt64Array requires 'new'") #endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */ @@ -610,21 +521,17 @@ ECMA_ERROR_DEF (ECMA_ERR_FRACTION_DIGITS_OUT_OF_RANGE, "Fraction digits must be #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_RETURN_VALUE_IS_NOT_AN_ARRAYBUFFER_OBJECT, "Return value is not an ArrayBuffer object") #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_SUPER_CONSTRUCTOR_MAY_ONLY_BE_CALLED_ONCE, "Super constructor may only be called once") -#endif /* JERRY_ESNEXT */ ECMA_ERROR_DEF (ECMA_ERR_BINDING_NOT_EXIST_OR_UNINITIALIZED, "Binding does not exist or is uninitialised") -#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT +#if JERRY_BUILTIN_ARRAY ECMA_ERROR_DEF (ECMA_ERR_CANNOT_CONVERT_TO_OBJECT, "Cannot convert undefined or null to object") -#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_ARRAY */ #if JERRY_BUILTIN_NUMBER ECMA_ERROR_DEF (ECMA_ERR_PRECISION_DIGITS_MUST_BE_BETWEEN_IN_RANGE, "Precision digits must be between 1 and 100") #endif /* JERRY_BUILTIN_NUMBER */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_PRIVATE_FIELD_WAS_DEFINED_WITHOUT_A_GETTER, "Private field was defined without a getter") ECMA_ERROR_DEF (ECMA_ERR_PRIVATE_FIELD_WAS_DEFINED_WITHOUT_A_SETTER, "Private field was defined without a setter") ECMA_ERROR_DEF (ECMA_ERR_PROPERTY_NAME_IS_NEITHER_SYMBOL_NOR_STRING, "Property name is neither Symbol nor string") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT ECMA_ERROR_DEF (ECMA_ERR_STRING_CANNOT_BE_CONVERTED_TO_BIGINT_VALUE, "String cannot be converted to BigInt value") #endif /* JERRY_BUILTIN_BIGINT */ @@ -634,16 +541,16 @@ ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_TYPE_CALL, "Operator called on incorrect cont #if JERRY_BUILTIN_ARRAY ECMA_ERROR_DEF (ECMA_ERR_REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE, "Reduce of empty Array with no initial value") #endif /* JERRY_BUILTIN_ARRAY */ -#if JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT) +#if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_REG_EXP_OBJECT, "Argument 'this' is not a valid RegExp object") -#endif /* JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT) */ +#endif /* JERRY_BUILTIN_REGEXP */ #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ARRAY_BUFFER_OBJECT, "Argument 'this' is not an ArrayBuffer object") #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT +#if JERRY_ERROR_MESSAGES ECMA_ERROR_DEF (ECMA_ERR_ARROW_FUNCTIONS_INVOKE_WITH_NEW, "Arrow functions cannot be invoked with 'new'") ECMA_ERROR_DEF (ECMA_ERR_ASYNC_FUNCTIONS_INVOKE_WITH_NEW, "Async functions cannot be invoked with 'new'") -#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */ +#endif /* JERRY_ERROR_MESSAGES */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_SET_EXTENSIBLE_PROPERTY, "Cannot set [[Extensible]] property of object") #endif /* JERRY_BUILTIN_PROXY */ @@ -653,23 +560,16 @@ ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_SHAREDARRAYBUFFER_REQUIRES_NEW, "Constructo #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT8_CLAMPED_ARRAY_REQUIRES_NEW, "Constructor Uint8ClampedArray requires 'new'") #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_BUILTIN_BIGINT && JERRY_ESNEXT +#if JERRY_BUILTIN_BIGINT ECMA_ERROR_DEF (ECMA_ERR_NEGATIVE_EXPONENT_IS_NOT_ALLOWED_FOR_BIGINTS, "Negative exponent is not allowed for BigInts") -#endif /* JERRY_BUILTIN_BIGINT && JERRY_ESNEXT */ -#if JERRY_ESNEXT +#endif /* JERRY_BUILTIN_BIGINT */ ECMA_ERROR_DEF (ECMA_ERR_PROMISE_ALL_REMAINING_ELEMENTS_LIMIT_REACHED, "Promise.all remaining elements limit reached") ECMA_ERROR_DEF (ECMA_ERR_VALUE_RECEIVED_BY_FOR_ASYNC_OF_IS_NOT_OBJECT, "Value received by for-async-of is not object") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT ECMA_ERROR_DEF (ECMA_ERR_INFINITY_OR_NAN_CANNOT_BE_CONVERTED_TO_BIGINT, "Infinity or NaN cannot be converted to BigInt") #endif /* JERRY_BUILTIN_BIGINT */ -#if JERRY_BUILTIN_REGEXP && !(JERRY_ESNEXT) -ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION, "Invalid argument is passed to RegExp function") -#endif /* JERRY_BUILTIN_REGEXP && !(JERRY_ESNEXT) */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_OPERATOR_DELETE_RETURNED_FALSE_IN_STRICT_MODE, "Operator delete returned false in strict mode") ECMA_ERROR_DEF (ECMA_ERR_PROPERTY_PROTOTYPE_IS_NOT_AN_OBJECT, "Property 'prototype' is not an object or null") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_PROXY_HANDLER_IS_NULL_FOR_ISARRAY_OPERATION, "Proxy handler is null for 'isArray' operation") #endif /* JERRY_BUILTIN_PROXY */ @@ -680,23 +580,19 @@ ECMA_ERROR_DEF (ECMA_ERR_RIGHT_VALUE_OF_INSTANCEOF_MUST_BE_AN_OBJECT, "Right val #if JERRY_SNAPSHOT_EXEC ECMA_ERROR_DEF (ECMA_ERR_STATIC_SNAPSHOTS_CANNOT_BE_COPIED_INTO_MEMORY, "Static snapshots cannot be copied into memory") #endif /* JERRY_SNAPSHOT_EXEC */ -#if JERRY_ESNEXT && JERRY_SNAPSHOT_SAVE -ECMA_ERROR_DEF (ECMA_ERR_TAGGED_TEMPLATE_LITERALS, "Unsupported feature: tagged template literals") -#endif /* JERRY_ESNEXT && JERRY_SNAPSHOT_SAVE */ #if JERRY_SNAPSHOT_SAVE +ECMA_ERROR_DEF (ECMA_ERR_TAGGED_TEMPLATE_LITERALS, "Unsupported feature: tagged template literals") ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_FLAG_NOT_SUPPORTED, "Unsupported generate snapshot flags specified") #endif /* JERRY_SNAPSHOT_SAVE */ #if JERRY_SNAPSHOT_EXEC ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_SNAPSHOT_EXEC_FLAGS_ARE_SPECIFIED, "Unsupported snapshot exec flags are specified") #endif /* JERRY_SNAPSHOT_EXEC */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_VALUE_FOR_CLASS_HERITAGE_IS_NOT_A_CONSTRUCTOR, "Value for class heritage is not a constructor") -#endif /* JERRY_ESNEXT */ ECMA_ERROR_DEF (ECMA_ERR_TOO_MANY_ARGUMENTS_DECLARED_FOR_FUNCTION_APPLY, "Too many arguments declared for Function.apply") -#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT +#if JERRY_ERROR_MESSAGES ECMA_ERROR_DEF (ECMA_ERR_ACCESSOR_FUNCTIONS_INVOKE_WITH_NEW, "Accessor functions cannot be invoked with 'new'") -#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */ +#endif /* JERRY_ERROR_MESSAGES */ #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_LINK_TO_MODULE_IN_ERROR_STATE, "Cannot link to a module which is in error state") #endif /* JERRY_MODULE_SYSTEM */ @@ -711,18 +607,15 @@ ECMA_ERROR_DEF (ECMA_ERR_TYPEDARRAY_INTRINSTIC_DIRECTLY_CALLED, "TypedArray intr ECMA_ERROR_DEF (ECMA_ERR_UNSIGNED_RIGHT_SHIFT_IS_NOT_ALLOWED_FOR_BIGINTS, "Unsigned right shift is not allowed for BigInts") #endif /* JERRY_BUILTIN_BIGINT */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ASYNC_GENERATOR, "Argument 'this' is not an async generator object") ECMA_ERROR_DEF (ECMA_ERR_CLASS_EXTENDS_NOT_CONSTRUCTOR, "Class extends value is not a constructor or null") -#endif /* JERRY_ESNEXT */ -#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT +#if JERRY_ERROR_MESSAGES ECMA_ERROR_DEF (ECMA_ERR_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW, "Generator functions cannot be invoked with 'new'") -#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */ -#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT || JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT) +#endif /* JERRY_ERROR_MESSAGES */ +#if JERRY_BUILTIN_REGEXP ECMA_ERROR_DEF (ECMA_ERR_RETURN_VALUE_OF_EXEC_MUST_BE_AN_OBJECT_OR_NULL, "Return value of 'exec' must be an object or null") -#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT \ -|| JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT) */ +#endif /* JERRY_BUILTIN_REGEXP */ #if JERRY_BUILTIN_DATAVIEW ECMA_ERROR_DEF (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER, "Start offset is outside the bounds of the buffer") @@ -730,19 +623,15 @@ ECMA_ERROR_DEF (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER, #if JERRY_BUILTIN_SHAREDARRAYBUFFER ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER, "Argument 'this' is not a SharedArrayBuffer object") #endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CLASS_CONSTRUCTOR_NEW, "Class constructor cannot be invoked without 'new'") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_RETURN_PROXY_GET_TRAP, "Incorrect value is returned by a Proxy 'get' trap") ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_RETURN_PROXY_SET_TRAP, "Incorrect value is returned by a Proxy 'set' trap") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CLASS_IS_NON_CONFIGURABLE, "Prototype property of a class is non-configurable") -#endif /* JERRY_ESNEXT */ -#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT +#if JERRY_BUILTIN_ARRAY ECMA_ERROR_DEF (ECMA_ERR_PUSHING_TOO_HIGH_ELEMENT, "Pushing element over 2**53-1 length is disallowed") -#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_ARRAY */ ECMA_ERROR_DEF (ECMA_ERR_THE_REQUESTED_PROPERTY_UPDATE_CANNOT_BE_PERFORMED, "The requested property update cannot be performed") #if JERRY_BUILTIN_PROXY @@ -760,35 +649,33 @@ ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_STRING_OBJECT, "Argument 'this' is no ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER_OBJECT, "Argument 'this' is not an SharedArrayBuffer object") #endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */ -#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT +#if JERRY_ERROR_MESSAGES ECMA_ERROR_DEF (ECMA_ERR_ASYNC_ARROW_FUNCTIONS_INVOKE_WITH_NEW, "Async arrow functions cannot be invoked with 'new'") -#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */ -#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT +#endif /* JERRY_ERROR_MESSAGES */ +#if JERRY_BUILTIN_ARRAY ECMA_ERROR_DEF (ECMA_ERR_UNSHIFT_TOO_HIGH, "Unshift elements over 2**53-1 length is disallowed") -#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */ +#endif /* JERRY_BUILTIN_ARRAY */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_TRAP_RESULT_NOT_INCLUDE_ALL_NON_CONFIGURABLE_KEYS, "Trap result did not include all non-configurable keys") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT +#if JERRY_ERROR_MESSAGES ECMA_ERROR_DEF (ECMA_ERR_ASYNC_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW, "Async generator functions cannot be invoked with 'new'") -#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */ +#endif /* JERRY_ERROR_MESSAGES */ #if JERRY_BUILTIN_REFLECT ECMA_ERROR_DEF (ECMA_ERR_REFLECT_EXPECTS_AN_OBJECT_AS_SECOND_ARGUMENT, "Reflect.construct expects an object as second argument") #endif /* JERRY_BUILTIN_REFLECT */ -#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT +#if JERRY_ERROR_MESSAGES ECMA_ERROR_DEF (ECMA_ERR_SCRIPT_GLOBAL_FUNCTIONS_INVOKE_WITH_NEW, "Script (global) functions cannot be invoked with 'new'") -#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */ +#endif /* JERRY_ERROR_MESSAGES */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_CANNOT_CREATE_PROXY, "Cannot create Proxy with a non-object target or handler") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_DERIVED_CTOR_RETURN_NOR_OBJECT_OR_UNDEFINED, "Derived constructors may only return object or undefined") -#endif /* JERRY_ESNEXT */ #if JERRY_SNAPSHOT_EXEC ECMA_ERROR_DEF (ECMA_ERR_INVALID_SNAPSHOT_VERSION_OR_FEATURES, "Invalid snapshot version or unsupported features present") @@ -834,18 +721,14 @@ ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE_DIFFERENT_PROTOTYPE_RETURNED, ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_ADDING_PROPERTY_NON_EXTENSIBLE_TARGET, "Trap returned truish for adding property to the non-extensible target") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CANNOT_READ_PRIVATE_MEMBER_TO_AN_OBJECT_WHOSE_CLASS_DID_NOT_DECLARE_IT, "Cannot read private member to an object whose class did not declare it") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_GIVEN_PROPERTY_IS_A_NON_CONFIGURABLE, "Given property is a non-configurable data property on the proxy target") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CANNOT_WRITE_PRIVATE_MEMBER_TO_AN_OBJECT_WHOSE_CLASS_DID_NOT_DECLARE_IT, "Cannot write private member to an object whose class did not declare it") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_TRAP_FALSISH_PROPERTY_TARGET_NOT_EXTENSIBLE, "Trap returned falsish for property but the proxy target is not extensible") @@ -854,11 +737,8 @@ ECMA_ERROR_DEF (ECMA_ERR_PROXY_PROPERTY_NOT_CONFIGURABLE_NOT_HAVE_GETTER, ECMA_ERROR_DEF (ECMA_ERR_TARGET_PROPERTY_CONFIGURE_ACCESSOR_WITHOUT_SETTER, "The property of a Proxy target is a non configurable accessor without a setter") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT || JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_LET_CONST_NOT_INITIALIZED, "Variables declared by let/const must be initialized before reading their value") -#endif /* JERRY_ESNEXT \ -|| JERRY_MODULE_SYSTEM */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_PROPERTY_NON_CONFIGURABLE, "Trap returned truish for property which is non-configurable in the proxy target") @@ -867,10 +747,8 @@ ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE_NOT_RETURNED_ITS_PROTOTYPE, ECMA_ERROR_DEF (ECMA_ERR_TRAP_FALSISH_PROPERTY_NON_CONFIGURABLE, "Trap returned falsish for property which exists in the proxy target as non-configurable") #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT ECMA_ERROR_DEF (ECMA_ERR_CALL_SUPER_CONSTRUCTOR_DERIVED_CLASS_BEFORE_THIS, "Must call super constructor in derived class before accessing 'this' or returning from it") -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_PROXY ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_DEFINING_NON_EXISTENT_PROPERTY, "Trap returned truish for defining non-configurable property which is non-existent in the target") diff --git a/jerry-core/ecma/base/ecma-error-messages.ini b/jerry-core/ecma/base/ecma-error-messages.ini index d368ad9b..c2d7031a 100644 --- a/jerry-core/ecma/base/ecma-error-messages.ini +++ b/jerry-core/ecma/base/ecma-error-messages.ini @@ -130,7 +130,6 @@ ECMA_ERR_INVALID_UTF8_CODEPOINT = "Invalid UTF8 codepoint" ECMA_ERR_INVALID_UTF8_STRING = "Invalid UTF8 string" ECMA_ERR_INVALID_ENCODING = "Invalid encoding" ECMA_ERR_INVALID_ARGUMENT = "Invalid argument" -ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION = "Invalid argument is passed to RegExp function" ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE = "Invalid argument type in toPrimitive" ECMA_ERR_INVALID_CAPABILITY = "Invalid capability" ECMA_ERR_INVALID_CHARACTER_CLASS = "Invalid character class" @@ -213,7 +212,6 @@ ECMA_ERR_RESOLVE_MUST_BE_UNDEFINED = "Resolve must be undefined" ECMA_ERR_RESULT_OF_DEFAULTVALUE_IS_INVALID = "Result of [[DefaultValue]] is invalid" ECMA_ERR_RETURN_VALUE_IS_NOT_AN_ARRAYBUFFER_OBJECT = "Return value is not an ArrayBuffer object" ECMA_ERR_RETURN_VALUE_OF_EXEC_MUST_BE_AN_OBJECT_OR_NULL = "Return value of 'exec' must be an object or null" -ECMA_ERR_RETURNED_ARRAYBUFFER_HAS_BEEN_DETACHED = "Returned ArrayBuffer has been detached" ECMA_ERR_RIGHT_VALUE_OF_IN_MUST_BE_AN_OBJECT = "Right value of 'in' must be an object" ECMA_ERR_RIGHT_VALUE_OF_INSTANCEOF_MUST_BE_AN_OBJECT = "Right value of 'instanceof' must be an object" ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP = "Search string can't be of type: RegExp" @@ -279,8 +277,6 @@ ECMA_ERR_VALUE_MSG = "Argument cannot be marked as error" ECMA_ERR_WRONG_ARGS_MSG = "This type of argument is not allowed" ECMA_ERR_PARSER_NOT_SUPPORTED = "Source code parsing is disabled" ECMA_ERR_JSON_NOT_SUPPORTED = "JSON support is disabled" -ECMA_ERR_SYMBOL_NOT_SUPPORTED = "Symbol support is disabled" -ECMA_ERR_PROMISE_NOT_SUPPORTED = "Promise support is disabled" ECMA_ERR_TYPED_ARRAY_NOT_SUPPORTED = "TypedArray support is disabled" ECMA_ERR_SHARED_ARRAYBUFFER_NOT_SUPPORTED = "SharedArrayBuffer support is disabled" ECMA_ERR_DATA_VIEW_NOT_SUPPORTED = "DataView support is disabled" diff --git a/jerry-core/ecma/base/ecma-extended-info.c b/jerry-core/ecma/base/ecma-extended-info.c index 75181612..1dcf3d34 100644 --- a/jerry-core/ecma/base/ecma-extended-info.c +++ b/jerry-core/ecma/base/ecma-extended-info.c @@ -19,8 +19,6 @@ #include "byte-code.h" -#if JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING - /** \addtogroup ecma ECMA * @{ * @@ -118,7 +116,6 @@ ecma_compiled_code_resolve_extended_info (const ecma_compiled_code_t *bytecode_h ecma_value_t *base_p = ecma_compiled_code_resolve_arguments_start (bytecode_header_p); -#if JERRY_ESNEXT if (CBC_FUNCTION_GET_TYPE (bytecode_header_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR) { base_p--; @@ -128,7 +125,6 @@ ecma_compiled_code_resolve_extended_info (const ecma_compiled_code_t *bytecode_h { base_p--; } -#endif /* JERRY_ESNEXT */ #if JERRY_LINE_INFO if (bytecode_header_p->status_flags & CBC_CODE_FLAGS_HAS_LINE_INFO) @@ -142,8 +138,6 @@ ecma_compiled_code_resolve_extended_info (const ecma_compiled_code_t *bytecode_h return ((uint8_t *) base_p) - 1; } /* ecma_compiled_code_resolve_extended_info */ -#endif /* JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING */ - /** * @} * @} diff --git a/jerry-core/ecma/base/ecma-extended-info.h b/jerry-core/ecma/base/ecma-extended-info.h index 95fbcab4..57046bd2 100644 --- a/jerry-core/ecma/base/ecma-extended-info.h +++ b/jerry-core/ecma/base/ecma-extended-info.h @@ -25,8 +25,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING - /** * Vlq encoding: flag which is set for all bytes except the last one. */ @@ -48,8 +46,6 @@ uint32_t ecma_extended_info_get_encoded_length (uint32_t value); uint8_t *ecma_compiled_code_resolve_extended_info (const ecma_compiled_code_t *bytecode_header_p); -#endif /* JERRY_ESNEXT || JERRY_FUNCTION_TO_STRING */ - /** * @} * @} diff --git a/jerry-core/ecma/base/ecma-gc.c b/jerry-core/ecma/base/ecma-gc.c index 38b48f81..fa8b1cdc 100644 --- a/jerry-core/ecma/base/ecma-gc.c +++ b/jerry-core/ecma/base/ecma-gc.c @@ -43,9 +43,8 @@ #if JERRY_BUILTIN_TYPEDARRAY #include "ecma-typedarray-object.h" #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT + #include "ecma-promise-object.h" -#endif /* JERRY_ESNEXT */ /* TODO: Extract GC to a separate component */ @@ -176,12 +175,10 @@ ecma_gc_mark_global_object (ecma_global_object_t *global_object_p) /**< global o ecma_gc_set_object_visited (ecma_get_object_from_value (global_object_p->this_binding)); #endif /* JERRY_BUILTIN_REALMS */ -#if JERRY_ESNEXT if (global_object_p->global_scope_cp != global_object_p->global_env_cp) { ecma_gc_set_object_visited (ECMA_GET_NON_NULL_POINTER (ecma_object_t, global_object_p->global_scope_cp)); } -#endif /* JERRY_ESNEXT */ jmem_cpointer_t *builtin_objects_p = global_object_p->builtin_objects; @@ -311,7 +308,6 @@ ecma_gc_mark_properties (ecma_object_t *object_p, /**< object */ switch (property_pair_p->names_cp[index]) { -#if JERRY_ESNEXT case LIT_INTERNAL_MAGIC_STRING_ENVIRONMENT_RECORD: { ecma_environment_record_t *environment_record_p; @@ -349,7 +345,6 @@ ecma_gc_mark_properties (ecma_object_t *object_p, /**< object */ } break; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_CONTAINER case LIT_INTERNAL_MAGIC_STRING_WEAK_REFS: { @@ -511,7 +506,6 @@ ecma_gc_mark_bound_function_object (ecma_object_t *object_p) /**< bound function } } /* ecma_gc_mark_bound_function_object */ -#if JERRY_ESNEXT /** * Mark objects referenced by Promise built-in. */ @@ -555,8 +549,6 @@ ecma_gc_mark_promise_object (ecma_extended_object_t *ext_object_p) /**< extended } } /* ecma_gc_mark_promise_object */ -#endif /* JERRY_ESNEXT */ - #if JERRY_BUILTIN_CONTAINER /** * Mark objects referenced by Map built-in. @@ -653,7 +645,6 @@ ecma_gc_mark_set_object (ecma_object_t *object_p) /**< object */ } /* ecma_gc_mark_set_object */ #endif /* JERRY_BUILTIN_CONTAINER */ -#if JERRY_ESNEXT /** * Mark objects referenced by inactive generator functions, async functions, etc. */ @@ -786,8 +777,6 @@ ecma_gc_mark_executable_object (ecma_object_t *object_p) /**< object */ } } /* ecma_gc_mark_executable_object */ -#endif /* JERRY_ESNEXT */ - #if JERRY_BUILTIN_PROXY /** * Mark the objects referenced by a proxy object @@ -831,7 +820,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ switch (ecma_get_lex_env_type (object_p)) { -#if JERRY_ESNEXT case ECMA_LEXICAL_ENVIRONMENT_CLASS: { #if JERRY_MODULE_SYSTEM @@ -848,7 +836,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ #endif /* JERRY_MODULE_SYSTEM */ /* FALLTHRU */ } -#endif /* JERRY_ESNEXT */ case ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND: { ecma_object_t *binding_object_p = ecma_get_lex_env_binding_object (object_p); @@ -1000,7 +987,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ break; } #endif /* JERRY_BUILTIN_CONTAINER */ -#if JERRY_ESNEXT case ECMA_OBJECT_CLASS_GENERATOR: case ECMA_OBJECT_CLASS_ASYNC_GENERATOR: { @@ -1063,7 +1049,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ break; } #endif /* JERRY_BUILTIN_REGEXP */ -#endif /* JERRY_ESNEXT */ default: { /* The ECMA_OBJECT_CLASS__MAX type represents an uninitialized class. */ @@ -1086,14 +1071,12 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ { ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p; -#if JERRY_ESNEXT if (JERRY_UNLIKELY (ext_object_p->u.array.length_prop_and_hole_count & ECMA_ARRAY_TEMPLATE_LITERAL)) { /* Template objects are never marked. */ JERRY_ASSERT (object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE); return; } -#endif /* JERRY_ESNEXT */ if (ecma_op_array_is_fast_array (ext_object_p)) { @@ -1135,7 +1118,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ const ecma_compiled_code_t *compiled_code_p = ecma_op_function_get_compiled_code (ext_func_p); -#if JERRY_ESNEXT if (CBC_FUNCTION_IS_ARROW (compiled_code_p->status_flags)) { ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p; @@ -1150,7 +1132,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ ecma_gc_set_object_visited (ecma_get_object_from_value (arrow_func_p->new_target)); } } -#endif /* JERRY_ESNEXT */ #if JERRY_SNAPSHOT_EXEC if (JERRY_UNLIKELY (compiled_code_p->status_flags & CBC_CODE_FLAGS_STATIC_FUNCTION)) @@ -1169,18 +1150,15 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ ecma_gc_mark_bound_function_object (object_p); break; } -#if JERRY_ESNEXT || JERRY_BUILTIN_REALMS case ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION: { ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p; -#endif /* JERRY_ESNEXT || JERRY_BUILTIN_REALMS */ #if JERRY_BUILTIN_REALMS ecma_value_t realm_value = ext_func_p->u.built_in.realm_value; ecma_gc_set_object_visited (ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t, realm_value)); #endif /* JERRY_BUILTIN_REALMS */ -#if JERRY_ESNEXT if (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER) { switch (ext_func_p->u.built_in.routine_id) @@ -1248,19 +1226,13 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */ } } } -#endif /* JERRY_ESNEXT */ - -#if JERRY_ESNEXT || JERRY_BUILTIN_REALMS break; } -#endif /* JERRY_ESNEXT || JERRY_BUILTIN_REALMS */ -#if JERRY_ESNEXT case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION: { ecma_gc_mark_compiled_code (((ecma_extended_object_t *) object_p)->u.constructor_function.script_value); break; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_REALMS case ECMA_OBJECT_TYPE_NATIVE_FUNCTION: { @@ -1408,8 +1380,6 @@ ecma_free_fast_access_array (ecma_object_t *object_p) /**< fast access mode arra ecma_dealloc_extended_object (object_p, sizeof (ecma_extended_object_t)); } /* ecma_free_fast_access_array */ -#if JERRY_ESNEXT - /** * Free non-objects referenced by inactive generator functions, async functions, etc. * @@ -1531,8 +1501,6 @@ ecma_gc_free_executable_object (ecma_object_t *object_p) /**< object */ return size; } /* ecma_gc_free_executable_object */ -#endif /* JERRY_ESNEXT */ - JERRY_STATIC_ASSERT (!ECMA_PROPERTY_IS_RAW (ECMA_PROPERTY_TYPE_DELETED), ecma_property_type_deleted_must_not_be_raw_property); JERRY_STATIC_ASSERT ((ECMA_PROPERTY_TYPE_DELETED & ECMA_PROPERTY_FLAG_LCACHED) == 0, @@ -1601,7 +1569,6 @@ ecma_gc_free_property (ecma_object_t *object_p, /**< object */ switch (name_cp) { -#if JERRY_ESNEXT case LIT_INTERNAL_MAGIC_STRING_ENVIRONMENT_RECORD: { ecma_environment_record_t *environment_record_p; @@ -1636,7 +1603,6 @@ ecma_gc_free_property (ecma_object_t *object_p, /**< object */ ecma_compact_collection_destroy (compact_collection_p); break; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_WEAKREF || JERRY_BUILTIN_CONTAINER case LIT_INTERNAL_MAGIC_STRING_WEAK_REFS: { @@ -1787,9 +1753,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ { case ECMA_OBJECT_CLASS_STRING: case ECMA_OBJECT_CLASS_NUMBER: -#if JERRY_ESNEXT case ECMA_OBJECT_CLASS_SYMBOL: -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT case ECMA_OBJECT_CLASS_BIGINT: #endif /* JERRY_BUILTIN_BIGINT */ @@ -1833,12 +1797,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ #if JERRY_BUILTIN_DATE case ECMA_OBJECT_CLASS_DATE: { -#if JERRY_ESNEXT ext_object_size = sizeof (ecma_date_object_t); -#else /* !JERRY_ESNEXT */ - ecma_number_t *num_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.cls.u3.date); - ecma_dealloc_number (num_p); -#endif /* JERRY_ESNEXT */ break; } #endif /* JERRY_BUILTIN_DATE */ @@ -1853,7 +1812,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ break; } #endif /* JERRY_BUILTIN_REGEXP */ -#if JERRY_ESNEXT case ECMA_OBJECT_CLASS_STRING_ITERATOR: { ecma_value_t iterated_value = ext_object_p->u.cls.u3.iterated_value; @@ -1880,7 +1838,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ break; } #endif /* JERRY_BUILTIN_REGEXP */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_TYPEDARRAY case ECMA_OBJECT_CLASS_ARRAY_BUFFER: #if JERRY_BUILTIN_SHAREDARRAYBUFFER @@ -1932,7 +1889,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ break; } #endif /* JERRY_BUILTIN_DATAVIEW */ -#if JERRY_ESNEXT case ECMA_OBJECT_CLASS_GENERATOR: case ECMA_OBJECT_CLASS_ASYNC_GENERATOR: { @@ -1959,7 +1915,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ ext_object_size = sizeof (ecma_async_from_sync_iterator_object_t); break; } -#endif /* JERRY_ESNEXT */ #if JERRY_MODULE_SYSTEM case ECMA_OBJECT_CLASS_MODULE: { @@ -2013,14 +1968,12 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ ecma_compiled_code_t *byte_code_p = (ECMA_GET_INTERNAL_VALUE_POINTER (ecma_compiled_code_t, ext_func_p->u.function.bytecode_cp)); -#if JERRY_ESNEXT if (CBC_FUNCTION_IS_ARROW (byte_code_p->status_flags)) { ecma_free_value_if_not_object (((ecma_arrow_function_t *) object_p)->this_binding); ecma_free_value_if_not_object (((ecma_arrow_function_t *) object_p)->new_target); ext_object_size = sizeof (ecma_arrow_function_t); } -#endif /* JERRY_ESNEXT */ ecma_bytecode_deref (byte_code_p); #if JERRY_SNAPSHOT_EXEC @@ -2043,7 +1996,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ break; } -#if JERRY_ESNEXT if (extended_func_p->u.built_in.id != ECMA_BUILTIN_ID_HANDLER) { break; @@ -2096,7 +2048,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ JERRY_UNREACHABLE (); } } -#endif /* JERRY_ESNEXT */ break; } case ECMA_OBJECT_TYPE_BOUND_FUNCTION: @@ -2106,9 +2057,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ ecma_value_t args_len_or_this = bound_func_p->header.u.bound_function.args_len_or_this; -#if JERRY_ESNEXT ecma_free_value (bound_func_p->target_length); -#endif /* JERRY_ESNEXT */ if (!ecma_is_value_integer_number (args_len_or_this)) { @@ -2128,13 +2077,11 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */ ext_object_size += args_size; break; } -#if JERRY_ESNEXT case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION: { ecma_script_deref (((ecma_extended_object_t *) object_p)->u.constructor_function.script_value); break; } -#endif /* JERRY_ESNEXT */ case ECMA_OBJECT_TYPE_NATIVE_FUNCTION: { ext_object_size = sizeof (ecma_native_function_t); diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h index 91bb9c54..75c70e19 100644 --- a/jerry-core/ecma/base/ecma-globals.h +++ b/jerry-core/ecma/base/ecma-globals.h @@ -111,17 +111,13 @@ typedef enum * and the first value is the source code */ ECMA_PARSE_HAS_ARGUMENT_LIST_VALUE = (1u << 12), /**< source_p points to a value list * and the second value is the argument list */ -#if JERRY_ESNEXT ECMA_PARSE_GENERATOR_FUNCTION = (1u << 13), /**< generator function is parsed */ ECMA_PARSE_ASYNC_FUNCTION = (1u << 14), /**< async function is parsed */ -#endif /* JERRY_ESNEXT */ /* These flags are internally used by the parser. */ ECMA_PARSE_INTERNAL_FREE_SOURCE = (1u << 15), /**< free source_p data */ ECMA_PARSE_INTERNAL_FREE_ARG_LIST = (1u << 16), /**< free arg_list_p data */ -#if JERRY_ESNEXT ECMA_PARSE_INTERNAL_PRE_SCANNING = (1u << 17), /**< the parser is in pre-scanning mode */ -#endif /* JERRY_ESNEXT */ #if JERRY_MODULE_SYSTEM ECMA_PARSE_INTERNAL_HAS_IMPORT_META = (1u << 18), /**< module has import.meta expression */ #endif /* JERRY_MODULE_SYSTEM */ @@ -215,10 +211,8 @@ enum * or function call argument list */ /* Other values */ ECMA_VALUE_ARGUMENT_NO_TRACK = ECMA_MAKE_VALUE (12), /**< represents not-tracked arguments formal parameter */ -#if JERRY_ESNEXT ECMA_VALUE_SYNC_ITERATOR = ECMA_MAKE_VALUE (13), /**< option for ecma_op_get_iterator: sync iterator is requested */ ECMA_VALUE_ASYNC_ITERATOR = ECMA_MAKE_VALUE (14), /**< option for ecma_op_get_iterator: async iterator is requested */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_GLOBAL_THIS ECMA_VALUE_GLOBAL_THIS = ECMA_MAKE_VALUE (15), /**< globalThis built-in */ #endif /* JERRY_BUILTIN_GLOBAL_THIS */ @@ -322,8 +316,6 @@ typedef struct ecma_native_pointer_chain_t struct ecma_native_pointer_chain_t *next_p; /**< next in the list */ } ecma_native_pointer_chain_t; -#if JERRY_ESNEXT - /** * Representation for class constructor environment record. */ @@ -333,8 +325,6 @@ typedef struct ecma_value_t function_object; /**< function object */ } ecma_environment_record_t; -#endif /* JERRY_ESNEXT */ - /** * Property list: * The property list of an object is a chain list of various items. @@ -357,10 +347,8 @@ typedef enum * that are not indices */ ECMA_LIST_ENUMERABLE = (1 << 1), /**< exclude non-enumerable properties */ ECMA_LIST_PROTOTYPE = (1 << 2), /**< list properties from prototype chain */ -#if JERRY_ESNEXT ECMA_LIST_SYMBOLS = (1 << 3), /**< list symbol properties */ ECMA_LIST_SYMBOLS_ONLY = (1 << 4), /**< list symbol properties only */ -#endif /* JERRY_ESNEXT */ ECMA_LIST_CONVERT_FAST_ARRAYS = (1 << 5), /**< after listing the properties convert * the fast access mode array back to normal array */ } ecma_list_properties_options_t; @@ -395,9 +383,7 @@ typedef enum ECMA_PROPERTY_FLAG_BUILT_IN = (1u << 3), /**< property is defined by the ECMAScript standard */ ECMA_FAST_ARRAY_FLAG = (1u << 3), /**< array is fast array */ ECMA_PROPERTY_FLAG_LCACHED = (1u << 4), /**< property is lcached */ -#if JERRY_ESNEXT ECMA_ARRAY_TEMPLATE_LITERAL = (1u << 4), /**< array is a template literal constructed by the parser */ -#endif /* JERRY_ESNEXT */ ECMA_PROPERTY_FLAG_DATA = (1u << 5), /**< property contains data */ /* The last two bits contains an ECMA_DIRECT_STRING value. */ } ecma_property_flags_t; @@ -463,11 +449,7 @@ typedef enum /** * Default flag of length property. */ -#if JERRY_ESNEXT #define ECMA_PROPERTY_FLAG_DEFAULT_LENGTH ECMA_PROPERTY_FLAG_CONFIGURABLE -#else /* !JERRY_ESNEXT */ -#define ECMA_PROPERTY_FLAG_DEFAULT_LENGTH ECMA_PROPERTY_FIXED -#endif /* JERRY_ESNEXT */ /** * Shift for property name part. @@ -743,8 +725,7 @@ typedef enum ECMA_OBJECT_CLASS_MODULE_NAMESPACE, /**< Module Namespace (ECMAScript v11, 9.4.6) */ #endif /* JERRY_MODULE_SYSTEM */ -/* These objects are marked by Garbage Collector. */ -#if JERRY_ESNEXT + /* These objects are marked by Garbage Collector. */ ECMA_OBJECT_CLASS_GENERATOR, /**< Generator object (ECMAScript v6, 25.2) */ ECMA_OBJECT_CLASS_ASYNC_GENERATOR, /**< Async generator object (ECMAScript v11, 25.3) */ ECMA_OBJECT_CLASS_ARRAY_ITERATOR, /**< Array iterator object (ECMAScript v6, 22.1.5.1) */ @@ -753,15 +734,12 @@ typedef enum #if JERRY_BUILTIN_REGEXP ECMA_OBJECT_CLASS_REGEXP_STRING_ITERATOR, /** RegExp string iterator object (ECMAScript v11, 21.2.7) */ #endif /* JERRY_BUILTIN_REGEXP */ -#endif /* JERRY_ESNEXT */ #if JERRY_MODULE_SYSTEM ECMA_OBJECT_CLASS_MODULE, /**< Module (ECMAScript v6, 15.2) */ #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT ECMA_OBJECT_CLASS_PROMISE, /**< Promise (ECMAScript v6, 25.4) */ ECMA_OBJECT_CLASS_PROMISE_CAPABILITY, /**< Promise capability (ECMAScript v6, 25.4.1.1) */ ECMA_OBJECT_CLASS_ASYNC_FROM_SYNC_ITERATOR, /**< AsyncFromSyncIterator (ECMAScript v11, 25.1.4) */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_DATAVIEW ECMA_OBJECT_CLASS_DATAVIEW, /**< DataView (ECMAScript v6, 24.2) */ #endif /* JERRY_BUILTIN_DATAVIEW */ @@ -783,10 +761,8 @@ typedef enum #if JERRY_BUILTIN_REGEXP ECMA_OBJECT_CLASS_REGEXP, /**< RegExp Object (ECMAScript v5.1, 15.10) */ #endif /* JERRY_BUILTIN_REGEXP */ -#if JERRY_ESNEXT ECMA_OBJECT_CLASS_SYMBOL, /**< Symbol object (ECMAScript v6, 4.3.27) */ ECMA_OBJECT_CLASS_STRING_ITERATOR, /**< String iterator object (ECMAScript v6, 22.1.5.1) */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_TYPEDARRAY ECMA_OBJECT_CLASS_ARRAY_BUFFER, /**< Array Buffer (ECMAScript v6, 24.1) */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ @@ -810,9 +786,7 @@ typedef enum { /* Types between 0 - 12 are ecma_object_type_t. */ ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 13, /**< declarative lexical environment */ -#if JERRY_ESNEXT ECMA_LEXICAL_ENVIRONMENT_CLASS = 14, /**< lexical environment with class */ -#endif /* JERRY_ESNEXT */ ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND = 15, /**< object-bound lexical environment */ ECMA_LEXICAL_ENVIRONMENT_TYPE_START = ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE, /**< first lexical @@ -820,8 +794,6 @@ typedef enum ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND /**< maximum value */ } ecma_lexical_environment_type_t; -#if JERRY_ESNEXT - /** * Types of array iterators. */ @@ -833,8 +805,6 @@ typedef enum ECMA_ITERATOR__COUNT, /**< number of iterator kinds */ } ecma_iterator_kind_t; -#endif /* JERRY_ESNEXT */ - /** * Offset for JERRY_CONTEXT (status_flags) top 8 bits. */ @@ -1063,11 +1033,9 @@ typedef struct #if JERRY_MODULE_SYSTEM uint8_t module_state; /**< Module state */ #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT uint8_t iterator_kind; /**< type of iterator */ uint8_t regexp_string_iterator_flags; /**< flags for RegExp string iterator */ uint8_t promise_flags; /**< Promise object flags */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_CONTAINER uint8_t container_flags; /**< container object flags */ #endif /* JERRY_BUILTIN_CONTAINER */ @@ -1085,10 +1053,8 @@ typedef struct #if JERRY_MODULE_SYSTEM uint16_t module_flags; /**< Module flags */ #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT uint16_t iterator_index; /**< for %Iterator%: [[%Iterator%NextIndex]] property */ uint16_t executable_obj_flags; /**< executable object flags */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_CONTAINER uint16_t container_id; /**< magic string id of a container */ #endif /* JERRY_BUILTIN_CONTAINER */ @@ -1102,21 +1068,16 @@ typedef struct union { ecma_value_t value; /**< value of the object (e.g. boolean, number, string, etc.) */ -#if !JERRY_ESNEXT - ecma_value_t date; /**< Date object [[DateValue]] internal property */ -#endif /* !JERRY_ESNEXT */ ecma_value_t target; /**< [[ProxyTarget]] or [[WeakRefTarget]] internal property */ #if JERRY_BUILTIN_TYPEDARRAY ecma_value_t arraybuffer; /**< for typedarray: ArrayBuffer reference */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT ecma_value_t head; /**< points to the async generator task queue head item */ ecma_value_t iterated_value; /**< for %Iterator%: [[IteratedObject]] property */ ecma_value_t promise; /**< PromiseCapability[[Promise]] internal slot */ ecma_value_t sync_iterator; /**< IteratorRecord [[Iterator]] internal slot for AsyncFromSyncIterator */ ecma_value_t spread_value; /**< for spread object: spreaded element */ int32_t tza; /**< TimeZone adjustment for date objects */ -#endif /* JERRY_ESNEXT */ uint32_t length; /**< length related property (e.g. length of ArrayBuffer) */ uint32_t arguments_number; /**< for arguments: arguments number */ #if JERRY_MODULE_SYSTEM @@ -1153,7 +1114,6 @@ typedef struct ecma_value_t args_len_or_this; /**< length of arguments or this value */ } bound_function; -#if JERRY_ESNEXT /** * Description of implicit class constructor function. */ @@ -1162,7 +1122,6 @@ typedef struct ecma_value_t script_value; /**< script value */ uint8_t flags; /**< constructor flags */ } constructor_function; -#endif /* JERRY_ESNEXT */ } u; } ecma_extended_object_t; @@ -1245,9 +1204,7 @@ typedef struct typedef struct { ecma_extended_object_t header; /**< extended object header */ -#if JERRY_ESNEXT ecma_value_t target_length; /**< length of target function */ -#endif /* JERRY_ESNEXT */ } ecma_bound_function_t; #if JERRY_SNAPSHOT_EXEC @@ -1263,8 +1220,6 @@ typedef struct #endif /* JERRY_SNAPSHOT_EXEC */ -#if JERRY_ESNEXT - /** * Description of arrow function objects. */ @@ -1288,8 +1243,6 @@ typedef struct #endif /* JERRY_SNAPSHOT_EXEC */ -#endif /* JERRY_ESNEXT */ - #if JERRY_BUILTIN_CONTAINER /** * Flags for container objects @@ -1711,12 +1664,10 @@ typedef struct } u; } ecma_extended_string_t; -#if JERRY_ESNEXT /** * Required number of ecma values in a compact collection to represent PrivateElement */ #define ECMA_PRIVATE_ELEMENT_LIST_SIZE 3 -#endif /* JERRY_ESNEXT */ /** * String builder header @@ -1943,8 +1894,6 @@ typedef struct #endif /* JERRY_BUILTIN_BIGINT */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT - /** * Executable (e.g. generator, async) object flags. */ @@ -2060,8 +2009,6 @@ typedef enum ECMA_PROMISE_ANY_REJECT, /**< promise.any reject */ } ecma_promise_executor_type_t; -#endif /* JERRY_ESNEXT */ - #if JERRY_BUILTIN_DATAVIEW /** * Description of DataView objects. @@ -2174,21 +2121,12 @@ typedef struct } ecma_revocable_proxy_object_t; #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT /** * Type to repesent the maximum property index * * For ES6+ the maximum valid property index is 2**53 - 1 */ typedef uint64_t ecma_length_t; -#else /* !JERRY_ESNEXT */ -/** - * Type to repesent the maximum property index - * - * For ES5+ the maximum valid property index is 2**32 - 1 - */ -typedef uint32_t ecma_length_t; -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT @@ -2270,8 +2208,6 @@ typedef struct } u; } ecma_mapped_arguments_t; -#if JERRY_ESNEXT - /** * Date object descriptor flags */ @@ -2328,8 +2264,6 @@ typedef enum */ #define ECMA_PRIVATE_PROPERTY_KIND(prop) ((prop) & ((ECMA_PRIVATE_PROPERTY_STATIC_FLAG - 1))) -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/base/ecma-helpers-collection.c b/jerry-core/ecma/base/ecma-helpers-collection.c index cecb3cdb..50afc5c5 100644 --- a/jerry-core/ecma/base/ecma-helpers-collection.c +++ b/jerry-core/ecma/base/ecma-helpers-collection.c @@ -80,8 +80,6 @@ ecma_collection_free_objects (ecma_collection_t *collection_p) /**< value collec ecma_collection_destroy (collection_p); } /* ecma_collection_free_objects */ -#if JERRY_ESNEXT - /** * Free the template literal objects and deallocate the collection */ @@ -118,8 +116,6 @@ ecma_collection_free_template_literal (ecma_collection_t *collection_p) /**< val ecma_collection_destroy (collection_p); } /* ecma_collection_free_template_literal */ -#endif /* JERRY_ESNEXT */ - /** * Free the non-object collection elements and deallocate the collection */ diff --git a/jerry-core/ecma/base/ecma-helpers-conversion.c b/jerry-core/ecma/base/ecma-helpers-conversion.c index 66879bfd..db22503a 100644 --- a/jerry-core/ecma/base/ecma-helpers-conversion.c +++ b/jerry-core/ecma/base/ecma-helpers-conversion.c @@ -293,12 +293,6 @@ ecma_utf8_string_to_number_by_radix (const lit_utf8_byte_t *str_p, /**< utf-8 st uint32_t radix, /**< radix */ uint32_t options) /**< option flags */ { -#if JERRY_ESNEXT - bool allow_underscore = (options & ECMA_CONVERSION_ALLOW_UNDERSCORE); -#else /* !JERRY_ESNEXT */ - JERRY_UNUSED (options); -#endif /* !JERRY_ESNEXT */ - JERRY_ASSERT (radix == 2 || radix == 8 || radix == 16); JERRY_ASSERT (*str_p == LIT_CHAR_0); @@ -319,12 +313,10 @@ ecma_utf8_string_to_number_by_radix (const lit_utf8_byte_t *str_p, /**< utf-8 st { lit_utf8_byte_t digit = *str_p++; -#if JERRY_ESNEXT - if (digit == LIT_CHAR_UNDERSCORE && allow_underscore) + if (digit == LIT_CHAR_UNDERSCORE && (options & ECMA_CONVERSION_ALLOW_UNDERSCORE)) { continue; } -#endif /* JERRY_ESNEXT */ if (!lit_char_is_hex_digit (digit)) { @@ -405,13 +397,11 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */ /* Parsing integer part */ while (str_p < end_p) { -#if JERRY_ESNEXT if (*str_p == LIT_CHAR_UNDERSCORE && (options & ECMA_CONVERSION_ALLOW_UNDERSCORE)) { str_p++; continue; } -#endif /* JERRY_ESNEXT */ if (!lit_char_is_decimal_digit (*str_p)) { @@ -444,13 +434,11 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */ while (str_p < end_p) { -#if JERRY_ESNEXT if (*str_p == LIT_CHAR_UNDERSCORE && (options & ECMA_CONVERSION_ALLOW_UNDERSCORE)) { str_p++; continue; } -#endif /* JERRY_ESNEXT */ if (!lit_char_is_decimal_digit (*str_p)) { @@ -506,13 +494,11 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */ while (str_p < end_p) { -#if JERRY_ESNEXT if (*str_p == LIT_CHAR_UNDERSCORE && (options & ECMA_CONVERSION_ALLOW_UNDERSCORE)) { str_p++; continue; } -#endif /* JERRY_ESNEXT */ if (!lit_char_is_decimal_digit (*str_p)) { diff --git a/jerry-core/ecma/base/ecma-helpers-string.c b/jerry-core/ecma/base/ecma-helpers-string.c index bc4b4347..294bbaa8 100644 --- a/jerry-core/ecma/base/ecma-helpers-string.c +++ b/jerry-core/ecma/base/ecma-helpers-string.c @@ -205,7 +205,6 @@ ecma_new_ecma_string_from_magic_string_ex_id (lit_magic_string_ex_id_t id) /**< return string_desc_p; } /* ecma_new_ecma_string_from_magic_string_ex_id */ -#if JERRY_ESNEXT /** * Allocate new ecma-string and fill it with reference to the symbol descriptor * @@ -240,7 +239,6 @@ ecma_prop_name_is_symbol (ecma_string_t *string_p) /**< ecma-string */ return (!ECMA_IS_DIRECT_STRING (string_p) && ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_SYMBOL); } /* ecma_prop_name_is_symbol */ -#endif /* JERRY_ESNEXT */ /** * Allocate new UTF8 ecma-string and fill it with characters from the given utf8 buffer @@ -537,8 +535,6 @@ ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit) /**< code unit */ return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size); } /* ecma_new_ecma_string_from_code_unit */ -#if JERRY_ESNEXT - /** * Allocate new ecma-string and fill it with cesu-8 character which represents specified code units * @@ -555,8 +551,6 @@ ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, /**< code uni return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size); } /* ecma_new_ecma_string_from_code_units */ -#endif /* JERRY_ESNEXT */ - /** * Allocate new ecma-string and fill it with ecma-number * @@ -590,14 +584,12 @@ ecma_new_ecma_string_from_length (ecma_length_t number) /**< property length */ return (ecma_string_t *) ECMA_CREATE_DIRECT_STRING (ECMA_DIRECT_STRING_UINT, (uintptr_t) number); } -#if JERRY_ESNEXT JERRY_ASSERT ((ecma_number_t) number <= ECMA_NUMBER_MAX_SAFE_INTEGER); if (JERRY_UNLIKELY (number > UINT32_MAX)) { return ecma_new_ecma_string_from_number ((ecma_number_t) number); } -#endif /* JERRY_ESNEXT */ return ecma_new_non_direct_string_from_uint32 ((uint32_t) number); } /* ecma_new_ecma_string_from_length */ @@ -991,7 +983,6 @@ ecma_destroy_ecma_string (ecma_string_t *string_p) /**< ecma-string */ ecma_dealloc_string_buffer (string_p, ECMA_ASCII_STRING_GET_SIZE (string_p) + ECMA_ASCII_STRING_HEADER_SIZE); return; } -#if JERRY_ESNEXT case ECMA_STRING_CONTAINER_SYMBOL: { ecma_extended_string_t *symbol_p = (ecma_extended_string_t *) string_p; @@ -999,7 +990,6 @@ ecma_destroy_ecma_string (ecma_string_t *string_p) /**< ecma-string */ ecma_dealloc_extended_string (symbol_p); return; } -#endif /* JERRY_ESNEXT */ default: { JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC @@ -2349,8 +2339,6 @@ ecma_string_trim (const ecma_string_t *string_p) /**< pointer to an ecma string return ret_string_p; } /* ecma_string_trim */ -#if JERRY_ESNEXT - /** * Pad the beginning or the end of string with parameter given in fill_string to the length of max_length. * @@ -2442,7 +2430,6 @@ ecma_string_pad (ecma_value_t original_string_p, /**< Input ecma string */ return ecma_make_string_value (ecma_stringbuilder_finalize (&builder)); } /* ecma_string_pad */ -#endif /* JERRY_ESNEXT */ /** * Create an empty string builder @@ -2756,7 +2743,6 @@ ecma_stringbuilder_destroy (ecma_stringbuilder_t *builder_p) /**< string builder #endif /* JERRY_MEM_STATS */ } /* ecma_stringbuilder_destroy */ -#if JERRY_ESNEXT /** * AdvanceStringIndex operation * @@ -2803,7 +2789,6 @@ ecma_op_advance_string_index (ecma_string_t *str_p, /**< input string */ return next_index + 1; } /* ecma_op_advance_string_index */ -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/base/ecma-helpers-value.c b/jerry-core/ecma/base/ecma-helpers-value.c index b6fa4456..cc79baa9 100644 --- a/jerry-core/ecma/base/ecma-helpers-value.c +++ b/jerry-core/ecma/base/ecma-helpers-value.c @@ -327,12 +327,7 @@ ecma_is_value_string (ecma_value_t value) /**< ecma value */ extern inline bool JERRY_ATTR_CONST JERRY_ATTR_ALWAYS_INLINE ecma_is_value_symbol (ecma_value_t value) /**< ecma value */ { -#if JERRY_ESNEXT return (ecma_get_value_type_field (value) == ECMA_TYPE_SYMBOL); -#else /* JERRY_ESNEXT */ - JERRY_UNUSED (value); - return false; -#endif /* JERRY_ESNEXT */ } /* ecma_is_value_symbol */ /** @@ -374,11 +369,7 @@ ecma_is_value_bigint (ecma_value_t value) /**< ecma value */ extern inline bool JERRY_ATTR_CONST JERRY_ATTR_ALWAYS_INLINE ecma_is_value_prop_name (ecma_value_t value) /**< ecma value */ { -#if JERRY_ESNEXT return ecma_is_value_string (value) || ecma_is_value_symbol (value); -#else /* !JERRY_ESNEXT */ - return ecma_is_value_string (value); -#endif /* JERRY_ESNEXT */ } /* ecma_is_value_prop_name */ /** @@ -631,9 +622,7 @@ extern inline ecma_value_t JERRY_ATTR_PURE JERRY_ATTR_ALWAYS_INLINE ecma_make_string_value (const ecma_string_t *ecma_string_p) /**< string to reference in value */ { JERRY_ASSERT (ecma_string_p != NULL); -#if JERRY_ESNEXT JERRY_ASSERT (!ecma_prop_name_is_symbol ((ecma_string_t *) ecma_string_p)); -#endif /* JERRY_ESNEXT */ if ((((uintptr_t) ecma_string_p) & ECMA_VALUE_TYPE_MASK) != 0) { @@ -643,7 +632,6 @@ ecma_make_string_value (const ecma_string_t *ecma_string_p) /**< string to refer return ecma_pointer_to_ecma_value (ecma_string_p) | ECMA_TYPE_STRING; } /* ecma_make_string_value */ -#if JERRY_ESNEXT /** * Symbol value constructor * @@ -657,7 +645,6 @@ ecma_make_symbol_value (const ecma_string_t *ecma_symbol_p) /**< symbol to refer return ecma_pointer_to_ecma_value (ecma_symbol_p) | ECMA_TYPE_SYMBOL; } /* ecma_make_symbol_value */ -#endif /* JERRY_ESNEXT */ /** * Property-name value constructor @@ -669,12 +656,10 @@ ecma_make_prop_name_value (const ecma_string_t *ecma_prop_name_p) /**< property { JERRY_ASSERT (ecma_prop_name_p != NULL); -#if JERRY_ESNEXT if (ecma_prop_name_is_symbol ((ecma_string_t *) ecma_prop_name_p)) { return ecma_make_symbol_value (ecma_prop_name_p); } -#endif /* JERRY_ESNEXT */ return ecma_make_string_value (ecma_prop_name_p); } /* ecma_make_prop_name_value */ @@ -794,7 +779,6 @@ ecma_get_string_from_value (ecma_value_t value) /**< ecma value */ return (ecma_string_t *) ecma_get_pointer_from_ecma_value (value); } /* ecma_get_string_from_value */ -#if JERRY_ESNEXT /** * Get pointer to ecma-string from ecma value * @@ -807,7 +791,6 @@ ecma_get_symbol_from_value (ecma_value_t value) /**< ecma value */ return (ecma_string_t *) ecma_get_pointer_from_ecma_value (value); } /* ecma_get_symbol_from_value */ -#endif /* JERRY_ESNEXT */ /** * Get pointer to a property name from ecma value @@ -889,9 +872,7 @@ ecma_copy_value (ecma_value_t value) /**< value description */ return ecma_make_float_value (new_num_p); } -#if JERRY_ESNEXT case ECMA_TYPE_SYMBOL: -#endif /* JERRY_ESNEXT */ case ECMA_TYPE_STRING: { ecma_string_t *string_p = (ecma_string_t *) ecma_get_pointer_from_ecma_value (value); @@ -1113,9 +1094,7 @@ ecma_free_value (ecma_value_t value) /**< value description */ ecma_dealloc_number (number_p); break; } -#if JERRY_ESNEXT case ECMA_TYPE_SYMBOL: -#endif /* JERRY_ESNEXT */ case ECMA_TYPE_STRING: { ecma_string_t *string_p = (ecma_string_t *) ecma_get_pointer_from_ecma_value (value); @@ -1240,12 +1219,10 @@ ecma_get_typeof_lit_id (ecma_value_t value) /**< input ecma value */ { ret_value = LIT_MAGIC_STRING_STRING; } -#if JERRY_ESNEXT else if (ecma_is_value_symbol (value)) { ret_value = LIT_MAGIC_STRING_SYMBOL; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT else if (ecma_is_value_bigint (value)) { diff --git a/jerry-core/ecma/base/ecma-helpers.c b/jerry-core/ecma/base/ecma-helpers.c index 908c8388..c51be10d 100644 --- a/jerry-core/ecma/base/ecma-helpers.c +++ b/jerry-core/ecma/base/ecma-helpers.c @@ -164,8 +164,6 @@ ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, /**< out return new_lexical_environment_p; } /* ecma_create_object_lex_env */ -#if JERRY_ESNEXT - /** * Create a lexical environment with a specified size. * @@ -200,8 +198,6 @@ ecma_create_lex_env_class (ecma_object_t *outer_lexical_environment_p, /**< oute return new_lexical_environment_p; } /* ecma_create_lex_env_class */ -#endif /* JERRY_ESNEXT */ - /** * Check if the object is lexical environment. * @@ -303,13 +299,9 @@ ecma_get_lex_env_binding_object (const ecma_object_t *object_p) /**< object-boun { JERRY_ASSERT (object_p != NULL); JERRY_ASSERT (ecma_is_lexical_environment (object_p)); -#if JERRY_ESNEXT JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND || (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_CLASS && !ECMA_LEX_ENV_CLASS_IS_MODULE (object_p))); -#else /* !JERRY_ESNEXT */ - JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND); -#endif /* JERRY_ESNEXT */ return ECMA_GET_NON_NULL_POINTER (ecma_object_t, object_p->u1.bound_object_cp); } /* ecma_get_lex_env_binding_object */ @@ -1534,7 +1526,6 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */ ecma_script_deref (((cbc_uint8_arguments_t *) bytecode_p)->script_value); -#if JERRY_ESNEXT if (bytecode_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS) { ecma_collection_t *collection_p = ecma_compiled_code_get_tagged_template_collection (bytecode_p); @@ -1544,7 +1535,6 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */ JERRY_CONTEXT (ecma_gc_new_objects) += collection_p->item_count * 2; ecma_collection_free_template_literal (collection_p); } -#endif /* JERRY_ESNEXT */ #if JERRY_LINE_INFO if (bytecode_p->status_flags & CBC_CODE_FLAGS_HAS_LINE_INFO) @@ -1659,12 +1649,10 @@ ecma_script_get_from_value (ecma_value_t value) /**< compiled code */ ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t, ext_object_p->u.bound_function.target_function); continue; } -#if JERRY_ESNEXT case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION: { return ((ecma_extended_object_t *) object_p)->u.constructor_function.script_value; } -#endif /* JERRY_ESNEXT */ default: { return JMEM_CP_NULL; @@ -1702,8 +1690,6 @@ ecma_compiled_code_resolve_arguments_start (const ecma_compiled_code_t *bytecode return ((ecma_value_t *) byte_p) - ((cbc_uint16_arguments_t *) bytecode_header_p)->argument_end; } /* ecma_compiled_code_resolve_arguments_start */ -#if JERRY_ESNEXT - /** * Resolve the position of the function name of the compiled code * @@ -1738,8 +1724,6 @@ ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *b return ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t, base_p[-1]); } /* ecma_compiled_code_get_tagged_template_collection */ -#endif /* JERRY_ESNEXT */ - #if JERRY_LINE_INFO /** @@ -1755,7 +1739,6 @@ ecma_compiled_code_get_line_info (const ecma_compiled_code_t *bytecode_header_p) ecma_value_t *base_p = ecma_compiled_code_resolve_arguments_start (bytecode_header_p); -#if JERRY_ESNEXT if (CBC_FUNCTION_GET_TYPE (bytecode_header_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR) { base_p--; @@ -1765,7 +1748,6 @@ ecma_compiled_code_get_line_info (const ecma_compiled_code_t *bytecode_header_p) { base_p--; } -#endif /* JERRY_ESNEXT */ return ECMA_GET_INTERNAL_VALUE_POINTER (uint8_t, base_p[-1]); } /* ecma_compiled_code_get_line_info */ diff --git a/jerry-core/ecma/base/ecma-helpers.h b/jerry-core/ecma/base/ecma-helpers.h index 9a87c58e..0e98ea24 100644 --- a/jerry-core/ecma/base/ecma-helpers.h +++ b/jerry-core/ecma/base/ecma-helpers.h @@ -241,9 +241,7 @@ ecma_value_t ecma_make_number_value (ecma_number_t ecma_number); ecma_value_t ecma_make_int32_value (int32_t int32_number); ecma_value_t ecma_make_uint32_value (uint32_t uint32_number); ecma_value_t JERRY_ATTR_PURE ecma_make_string_value (const ecma_string_t *ecma_string_p); -#if JERRY_ESNEXT ecma_value_t JERRY_ATTR_PURE ecma_make_symbol_value (const ecma_string_t *ecma_symbol_p); -#endif /* JERRY_ESNEXT */ ecma_value_t JERRY_ATTR_PURE ecma_make_prop_name_value (const ecma_string_t *ecma_prop_name_p); ecma_value_t JERRY_ATTR_PURE ecma_make_magic_string_value (lit_magic_string_id_t id); ecma_value_t JERRY_ATTR_PURE ecma_make_object_value (const ecma_object_t *object_p); @@ -254,9 +252,7 @@ ecma_number_t JERRY_ATTR_PURE ecma_get_float_from_value (ecma_value_t value); ecma_number_t *ecma_get_pointer_from_float_value (ecma_value_t value); ecma_number_t JERRY_ATTR_PURE ecma_get_number_from_value (ecma_value_t value); ecma_string_t JERRY_ATTR_PURE *ecma_get_string_from_value (ecma_value_t value); -#if JERRY_ESNEXT ecma_string_t JERRY_ATTR_PURE *ecma_get_symbol_from_value (ecma_value_t value); -#endif /* JERRY_ESNEXT */ ecma_string_t JERRY_ATTR_PURE *ecma_get_prop_name_from_value (ecma_value_t value); ecma_object_t JERRY_ATTR_PURE *ecma_get_object_from_value (ecma_value_t value); ecma_extended_primitive_t JERRY_ATTR_PURE *ecma_get_extended_primitive_from_value (ecma_value_t value); @@ -277,11 +273,9 @@ void ecma_free_number (ecma_value_t value); lit_magic_string_id_t ecma_get_typeof_lit_id (ecma_value_t value); /* ecma-helpers-string.c */ -#if JERRY_ESNEXT ecma_string_t *ecma_new_symbol_from_descriptor_string (ecma_value_t string_desc); bool ecma_prop_name_is_symbol (ecma_string_t *string_p); ecma_length_t ecma_op_advance_string_index (ecma_string_t *str_p, ecma_length_t index_num, bool is_unicode); -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_CONTAINER ecma_string_t *ecma_new_map_key_string (ecma_value_t value); bool ecma_prop_name_is_map_key (ecma_string_t *string_p); @@ -293,9 +287,7 @@ ecma_string_t *ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8 ecma_string_t * ecma_new_ecma_external_string_from_cesu8 (const lit_utf8_byte_t *string_p, lit_utf8_size_t string_size, void *user_p); ecma_string_t *ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit); -#if JERRY_ESNEXT ecma_string_t *ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, ecma_char_t second_code_unit); -#endif /* JERRY_ESNEXT */ ecma_string_t *ecma_new_ecma_string_from_length (ecma_length_t index); ecma_string_t *ecma_new_ecma_string_from_uint32 (uint32_t uint32_number); ecma_string_t *ecma_new_non_direct_string_from_uint32 (uint32_t uint32_number); @@ -330,9 +322,6 @@ const lit_utf8_byte_t *ecma_string_get_chars (const ecma_string_t *string_p, bool ecma_compare_ecma_string_to_magic_id (const ecma_string_t *string_p, lit_magic_string_id_t id); bool ecma_string_is_empty (const ecma_string_t *string_p); bool ecma_string_is_length (const ecma_string_t *string_p); -#if JERRY_ESNEXT -bool ecma_compare_ecma_string_to_global_symbol (ecma_string_t *string_p, lit_magic_string_id_t property_id); -#endif /* JERRY_ESNEXT */ jmem_cpointer_t ecma_string_to_property_name (ecma_string_t *prop_name_p, ecma_property_t *name_type_p); ecma_string_t *ecma_string_from_property_name (ecma_property_t property, jmem_cpointer_t prop_name_cp); @@ -359,10 +348,8 @@ const lit_utf8_byte_t *ecma_string_trim_front (const lit_utf8_byte_t *start_p, c const lit_utf8_byte_t *ecma_string_trim_back (const lit_utf8_byte_t *start_p, const lit_utf8_byte_t *end_p); void ecma_string_trim_helper (const lit_utf8_byte_t **utf8_str_p, lit_utf8_size_t *utf8_str_size); ecma_string_t *ecma_string_trim (const ecma_string_t *string_p); -#if JERRY_ESNEXT ecma_value_t ecma_string_pad (ecma_value_t original_string_p, ecma_value_t max_length, ecma_value_t fill_string, bool pad_on_start); -#endif /* JERRY_ESNEXT */ ecma_stringbuilder_t ecma_stringbuilder_create (void); ecma_stringbuilder_t ecma_stringbuilder_create_from (ecma_string_t *string_p); @@ -409,9 +396,7 @@ void ecma_collection_destroy (ecma_collection_t *collection_p); void ecma_collection_free (ecma_collection_t *collection_p); void ecma_collection_free_if_not_object (ecma_collection_t *collection_p); void ecma_collection_free_objects (ecma_collection_t *collection_p); -#if JERRY_ESNEXT void ecma_collection_free_template_literal (ecma_collection_t *collection_p); -#endif /* JERRY_ESNEXT */ bool ecma_collection_check_duplicated_entries (ecma_collection_t *collection_p); bool ecma_collection_has_string_value (ecma_collection_t *collection_p, ecma_string_t *string_p); @@ -426,9 +411,7 @@ void ecma_compact_collection_destroy (ecma_value_t *compact_collection_p); ecma_object_t *ecma_create_object (ecma_object_t *prototype_object_p, size_t ext_object_size, ecma_object_type_t type); ecma_object_t *ecma_create_decl_lex_env (ecma_object_t *outer_lexical_environment_p); ecma_object_t *ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, ecma_object_t *binding_obj_p); -#if JERRY_ESNEXT ecma_object_t *ecma_create_lex_env_class (ecma_object_t *outer_lexical_environment_p, size_t lexical_env_size); -#endif /* JERRY_ESNEXT */ bool JERRY_ATTR_PURE ecma_is_lexical_environment (const ecma_object_t *object_p); void ecma_op_ordinary_object_set_extensible (ecma_object_t *object_p); ecma_object_type_t JERRY_ATTR_PURE ecma_get_object_type (const ecma_object_t *object_p); @@ -501,10 +484,8 @@ void ecma_bytecode_ref (ecma_compiled_code_t *bytecode_p); void ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p); ecma_value_t ecma_script_get_from_value (ecma_value_t value); ecma_value_t *ecma_compiled_code_resolve_arguments_start (const ecma_compiled_code_t *bytecode_header_p); -#if JERRY_ESNEXT ecma_value_t *ecma_compiled_code_resolve_function_name (const ecma_compiled_code_t *bytecode_header_p); ecma_collection_t *ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *bytecode_header_p); -#endif /* JERRY_ESNEXT */ #if JERRY_LINE_INFO uint8_t *ecma_compiled_code_get_line_info (const ecma_compiled_code_t *bytecode_header_p); #endif /* JERRY_LINE_INFO */ diff --git a/jerry-core/ecma/base/ecma-init-finalize.c b/jerry-core/ecma/base/ecma-init-finalize.c index 63801b3a..60a3b2e0 100644 --- a/jerry-core/ecma/base/ecma-init-finalize.c +++ b/jerry-core/ecma/base/ecma-init-finalize.c @@ -58,13 +58,9 @@ ecma_init (void) JERRY_CONTEXT (stack_base) = (uintptr_t) &sp; #endif /* (JERRY_STACK_LIMIT != 0) */ -#if JERRY_ESNEXT ecma_job_queue_init (); -#endif /* JERRY_ESNEXT */ -#if JERRY_ESNEXT JERRY_CONTEXT (current_new_target_p) = NULL; -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_TYPEDARRAY JERRY_CONTEXT (arraybuffer_compact_allocation_limit) = 256; @@ -77,9 +73,7 @@ ecma_init (void) void ecma_finalize (void) { -#if JERRY_ESNEXT JERRY_ASSERT (JERRY_CONTEXT (current_new_target_p) == NULL); -#endif /* JERRY_ESNEXT */ ecma_finalize_global_environment (); uint8_t runs = 0; @@ -93,7 +87,6 @@ ecma_finalize (void) } } while (JERRY_CONTEXT (ecma_gc_new_objects) != 0); -#if JERRY_ESNEXT jmem_cpointer_t *global_symbols_cp = JERRY_CONTEXT (global_symbols_cp); for (uint32_t i = 0; i < ECMA_BUILTIN_GLOBAL_SYMBOL_COUNT; i++) @@ -103,7 +96,6 @@ ecma_finalize (void) ecma_deref_ecma_string (ECMA_GET_NON_NULL_POINTER (ecma_string_t, global_symbols_cp[i])); } } -#endif /* JERRY_ESNEXT */ ecma_finalize_lit_storage (); } /* ecma_finalize */ diff --git a/jerry-core/ecma/base/ecma-literal-storage.c b/jerry-core/ecma/base/ecma-literal-storage.c index 3b97afbd..429691ab 100644 --- a/jerry-core/ecma/base/ecma-literal-storage.c +++ b/jerry-core/ecma/base/ecma-literal-storage.c @@ -29,7 +29,6 @@ * @{ */ -#if JERRY_ESNEXT /** * Free symbol list */ @@ -56,7 +55,6 @@ ecma_free_symbol_list (jmem_cpointer_t symbol_list_cp) /**< symbol list */ symbol_list_cp = next_item_cp; } } /* ecma_free_symbol_list */ -#endif /* JERRY_ESNEXT */ /** * Free string list @@ -146,9 +144,7 @@ ecma_free_bigint_list (jmem_cpointer_t bigint_list_cp) /**< bigint list */ void ecma_finalize_lit_storage (void) { -#if JERRY_ESNEXT ecma_free_symbol_list (JERRY_CONTEXT (symbol_list_first_cp)); -#endif /* JERRY_ESNEXT */ ecma_free_string_list (JERRY_CONTEXT (string_list_first_cp)); ecma_free_number_list (JERRY_CONTEXT (number_list_first_cp)); #if JERRY_BUILTIN_BIGINT @@ -729,13 +725,11 @@ ecma_snapshot_resolve_serializable_values (const ecma_compiled_code_t *compiled_ base_p -= argument_end; } -#if JERRY_ESNEXT /* function name */ if (CBC_FUNCTION_GET_TYPE (compiled_code_p->status_flags) != CBC_FUNCTION_CONSTRUCTOR) { base_p--; } -#endif /* JERRY_ESNEXT */ return base_p; } /* ecma_snapshot_resolve_serializable_values */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c index 84956daf..771fca8e 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.c @@ -25,13 +25,9 @@ #include "jrt.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" #define BUILTIN_INC_HEADER_NAME "ecma-builtin-aggregateerror-prototype.inc.h" #define BUILTIN_UNDERSCORED_ID aggregate_error_prototype #include "ecma-builtin-internal-routines-template.inc.h" - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h index f03cb638..b5b3a11a 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror-prototype.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Object properties: * (property name, object pointer getter) */ @@ -33,6 +31,4 @@ STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_AGGREGATE_ERROR_UL, ECMA_P /* ECMA-262 v5, 15.11.7.10 */ STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, LIT_MAGIC_STRING__EMPTY, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c index e1c25618..4313168b 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.c @@ -29,8 +29,6 @@ #include "jcontext.h" #include "jrt.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -109,5 +107,3 @@ ecma_builtin_aggregate_error_dispatch_construct (const ecma_value_t *arguments_l * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h index c343b41d..c7f0f6fb 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-aggregateerror.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Number properties: * (property name, number value, writable, enumerable, configurable) */ @@ -34,6 +32,4 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_AGGREGATE_ERROR_PROTOT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_AGGREGATE_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c index 308845ff..c295f7a0 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c @@ -19,8 +19,6 @@ #include "ecma-iterator-object.h" #include "ecma-typedarray-object.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -224,5 +222,3 @@ ecma_builtin_array_iterator_prototype_dispatch_routine (uint8_t builtin_routine_ * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h index 1338fb44..c74d68da 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h @@ -19,14 +19,10 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_ARRAY_ITERATOR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_ARRAY_ITERATOR_PROTOTYPE_OBJECT_NEXT, 0, 0) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c index 2caad899..5f67573a 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c @@ -16,13 +16,9 @@ #include "ecma-builtin-helpers.h" #include "ecma-builtins.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" #define BUILTIN_INC_HEADER_NAME "ecma-builtin-array-prototype-unscopables.inc.h" #define BUILTIN_UNDERSCORED_ID array_prototype_unscopables #include "ecma-builtin-internal-routines-template.inc.h" - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h index d4d79db8..2cc4bc50 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - SIMPLE_VALUE (LIT_MAGIC_STRING_AT, ECMA_VALUE_TRUE, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE) SIMPLE_VALUE (LIT_MAGIC_STRING_COPY_WITHIN, ECMA_VALUE_TRUE, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE) @@ -43,6 +41,4 @@ SIMPLE_VALUE (LIT_MAGIC_STRING_KEYS, ECMA_VALUE_TRUE, ECMA_PROPERTY_CONFIGURABLE SIMPLE_VALUE (LIT_MAGIC_STRING_VALUES, ECMA_VALUE_TRUE, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c index 7201a0c2..61b56127 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c @@ -48,10 +48,7 @@ enum { ECMA_ARRAY_PROTOTYPE_ROUTINE_START = 0, -/* Note: these 2 routine ids must be in this order */ -#if !JERRY_ESNEXT - ECMA_ARRAY_PROTOTYPE_TO_STRING, -#endif /* !JERRY_ESNEXT */ + /* Note: these 2 routine ids must be in this order */ ECMA_ARRAY_PROTOTYPE_SORT, ECMA_ARRAY_PROTOTYPE_CONCAT, ECMA_ARRAY_PROTOTYPE_TO_LOCALE_STRING, @@ -188,17 +185,14 @@ ecma_builtin_array_prototype_object_concat (const ecma_value_t args[], /**< argu ecma_object_t *obj_p) /**< array object */ { /* 2. */ -#if JERRY_ESNEXT ecma_object_t *new_array_p = ecma_op_array_species_create (obj_p, 0); if (JERRY_UNLIKELY (new_array_p == NULL)) { return ECMA_VALUE_ERROR; } -#else /* !JERRY_ESNEXT */ - ecma_object_t *new_array_p = ecma_op_new_array_object (0); -#endif /* JERRY_ESNEXT */ + /* 3. */ ecma_length_t new_length = 0; /* 5.b - 5.c for this_arg */ @@ -458,7 +452,6 @@ ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, / return ecma_make_uint32_value (new_length); } -#if JERRY_ESNEXT /* 5. */ if ((ecma_number_t) (length + arguments_number) > ECMA_NUMBER_MAX_SAFE_INTEGER) { @@ -477,34 +470,15 @@ ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, / } } - ecma_number_t n = (ecma_number_t) length; -#else /* JERRY_ESNEXT */ - ecma_number_t n = (ecma_number_t) length; - - /* 5. */ - for (ecma_length_t index = 0; index < arguments_number; index++, n++) - { - /* 5.b */ - ecma_string_t *index_str_p = ecma_new_ecma_string_from_number (n); - ecma_value_t put_value = ecma_op_object_put (obj_p, index_str_p, argument_list_p[index], true); - ecma_deref_ecma_string (index_str_p); - - if (ECMA_IS_VALUE_ERROR (put_value)) - { - return put_value; - } - } - -#endif /* JERRY_ESNEXT */ /* 6 - 7. */ - ecma_value_t set_length_value = ecma_builtin_array_prototype_helper_set_length (obj_p, n); + ecma_value_t set_length_value = ecma_builtin_array_prototype_helper_set_length (obj_p, (ecma_number_t) length); if (ECMA_IS_VALUE_ERROR (set_length_value)) { return set_length_value; } - return ecma_make_number_value (n); + return ecma_make_length_value (length); } /* ecma_builtin_array_prototype_object_push */ /** @@ -550,7 +524,6 @@ ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg, /**< this ar ecma_string_t *lower_str_p = ecma_new_ecma_string_from_length (lower); ecma_string_t *upper_str_p = ecma_new_ecma_string_from_length (upper); -#if JERRY_ESNEXT ecma_value_t lower_value = ECMA_VALUE_EMPTY; ecma_value_t upper_value = ECMA_VALUE_EMPTY; @@ -595,29 +568,6 @@ ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg, /**< this ar goto clean_up; } } -#else /* !JERRY_ESNEXT */ - ecma_value_t lower_value = ecma_op_object_get (obj_p, lower_str_p); - - if (ECMA_IS_VALUE_ERROR (lower_value)) - { - ecma_deref_ecma_string (lower_str_p); - ecma_deref_ecma_string (upper_str_p); - return ret_value; - } - - ecma_value_t upper_value = ecma_op_object_get (obj_p, upper_str_p); - - if (ECMA_IS_VALUE_ERROR (upper_value)) - { - goto clean_up; - } - - ecma_value_t has_lower = ecma_op_object_has_property (obj_p, lower_str_p); - ecma_value_t has_upper = ecma_op_object_has_property (obj_p, upper_str_p); - - bool lower_exist = ecma_is_value_true (has_lower); - bool upper_exist = ecma_is_value_true (has_upper); -#endif /* JERRY_ESNEXT */ if (lower_exist && upper_exist) { @@ -835,7 +785,7 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */ bool use_fast_path = ecma_op_object_is_fast_array (obj_p); ecma_length_t copied_length = (end > start) ? end - start : 0; -#if JERRY_ESNEXT + ecma_object_t *new_array_p = ecma_op_array_species_create (obj_p, copied_length); if (JERRY_UNLIKELY (new_array_p == NULL)) @@ -844,9 +794,6 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */ } use_fast_path &= ecma_op_object_is_fast_array (new_array_p); -#else /* !JERRY_ESNEXT */ - ecma_object_t *new_array_p = ecma_op_new_array_object (0); -#endif /* JERRY_ESNEXT */ if (use_fast_path && copied_length > 0) { @@ -872,7 +819,6 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */ ecma_extended_object_t *ext_to_obj_p = (ecma_extended_object_t *) new_array_p; -#if JERRY_ESNEXT uint32_t target_length = ext_to_obj_p->u.array.length; ecma_value_t *to_buffer_p; JERRY_ASSERT (copied_length <= UINT32_MAX); @@ -890,9 +836,6 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */ ecma_delete_fast_array_properties (new_array_p, (uint32_t) copied_length); to_buffer_p = ECMA_GET_NON_NULL_POINTER (ecma_value_t, new_array_p->u1.property_list_cp); } -#else /* !JERRY_ESNEXT */ - ecma_value_t *to_buffer_p = ecma_fast_array_extend (new_array_p, copied_length); -#endif /* JERRY_ESNEXT */ ecma_value_t *from_buffer_p = ECMA_GET_NON_NULL_POINTER (ecma_value_t, obj_p->u1.property_list_cp); @@ -901,9 +844,7 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */ for (uint32_t k = (uint32_t) start; k < (uint32_t) end; k++, n++) { -#if JERRY_ESNEXT ecma_free_value_if_not_object (to_buffer_p[n]); -#endif /* JERRY_ESNEXT */ to_buffer_p[n] = ecma_copy_value_if_not_object (from_buffer_p[k]); } @@ -932,27 +873,21 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */ { /* 10.c.ii */ ecma_value_t put_comp; -#if JERRY_ESNEXT - const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW; -#else /* !JERRY_ESNEXT */ - const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE; -#endif /* JERRY_ESNEXT */ - put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, n, get_value, prop_flags); + put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, + n, + get_value, + ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE + | JERRY_PROP_SHOULD_THROW); ecma_free_value (get_value); -#if JERRY_ESNEXT if (ECMA_IS_VALUE_ERROR (put_comp)) { ecma_deref_object (new_array_p); return put_comp; } -#else /* !JERRY_ESNEXT */ - JERRY_ASSERT (ecma_is_value_true (put_comp)); -#endif /* JERRY_ESNEXT */ } } -#if JERRY_ESNEXT ecma_value_t set_length_value = ecma_builtin_array_prototype_helper_set_length (new_array_p, ((ecma_number_t) n)); if (ECMA_IS_VALUE_ERROR (set_length_value)) @@ -960,7 +895,6 @@ ecma_builtin_array_prototype_object_slice (ecma_value_t arg1, /**< start */ ecma_deref_object (new_array_p); return set_length_value; } -#endif /* JERRY_ESNEXT */ return ecma_make_object_value (new_array_p); } /* ecma_builtin_array_prototype_object_slice */ @@ -1282,7 +1216,6 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu ecma_length_t new_length = len + insert_count - actual_delete_count; -#if JERRY_ESNEXT /* ES11: 8. */ if ((ecma_number_t) new_length > ECMA_NUMBER_MAX_SAFE_INTEGER) { @@ -1296,10 +1229,6 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu { return ECMA_VALUE_ERROR; } -#else /* !JERRY_ESNEXT */ - /* ES5.1: 2. */ - ecma_object_t *new_array_p = ecma_op_new_array_object (actual_delete_count); -#endif /* JERRY_ESNEXT */ /* ES5.1: 8, ES11: 10. */ ecma_length_t k = 0; @@ -1318,28 +1247,21 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu if (ecma_is_value_found (from_present)) { -#if JERRY_ESNEXT - const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW; -#else /* !JERRY_ESNEXT */ - const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE; -#endif /* JERRY_ESNEXT */ - - ecma_value_t put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, k, from_present, prop_flags); + ecma_value_t put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, + k, + from_present, + ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE + | JERRY_PROP_SHOULD_THROW); ecma_free_value (from_present); -#if JERRY_ESNEXT if (ECMA_IS_VALUE_ERROR (put_comp)) { ecma_deref_object (new_array_p); return put_comp; } -#else /* !JERRY_ESNEXT */ - JERRY_ASSERT (ecma_is_value_true (put_comp)); -#endif /* JERRY_ESNEXT */ } } -#if JERRY_ESNEXT /* ES11: 12. */ ecma_value_t set_length = ecma_builtin_array_prototype_helper_set_length (new_array_p, ((ecma_number_t) actual_delete_count)); @@ -1349,7 +1271,6 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu ecma_deref_object (new_array_p); return set_length; } -#endif /* JERRY_ESNEXT */ /* ES5.1: 12, ES11: 15. */ if (insert_count < actual_delete_count) @@ -1514,20 +1435,13 @@ ecma_builtin_array_prototype_object_unshift (const ecma_value_t args[], /**< arg } } -#if JERRY_ESNEXT - const bool should_iterate = args_number > 0; -#else /* !JERRY_ESNEXT */ - const bool should_iterate = true; -#endif /* JERRY_ESNEXT */ - if (should_iterate) + if (args_number > 0) { -#if JERRY_ESNEXT /* ES11:4.a. */ if ((ecma_number_t) (len + args_number) > ECMA_NUMBER_MAX_SAFE_INTEGER) { return ecma_raise_type_error (ECMA_ERR_UNSHIFT_TOO_HIGH); } -#endif /* JERRY_ESNEXT */ /* ES5.1:5.,6. ES11: 4.b, 4.c */ for (ecma_length_t k = len; k > 0; k--) @@ -1943,16 +1857,12 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */ } /* 6. */ -#if JERRY_ESNEXT ecma_object_t *new_array_p = ecma_op_array_species_create (obj_p, len); if (JERRY_UNLIKELY (new_array_p == NULL)) { return ECMA_VALUE_ERROR; } -#else /* !JERRY_ESNEXT */ - ecma_object_t *new_array_p = ecma_op_new_array_object (len); -#endif /* JERRY_ESNEXT */ JERRY_ASSERT (ecma_is_value_object (arg1)); ecma_object_t *func_object_p = ecma_get_object_from_value (arg1); @@ -1988,24 +1898,20 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */ /* 8.c.iii */ ecma_value_t put_comp; -#if JERRY_ESNEXT - const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW; -#else /* !JERRY_ESNEXT */ - const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE; -#endif /* JERRY_ESNEXT */ - put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, index, mapped_value, prop_flags); + put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, + index, + mapped_value, + ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE + | JERRY_PROP_SHOULD_THROW); ecma_free_value (mapped_value); ecma_free_value (current_value); -#if JERRY_ESNEXT + if (ECMA_IS_VALUE_ERROR (put_comp)) { ecma_deref_object (new_array_p); return put_comp; } -#else /* !JERRY_ESNEXT */ - JERRY_ASSERT (ecma_is_value_true (put_comp)); -#endif /* JERRY_ESNEXT */ } } @@ -2034,7 +1940,6 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn * } /* 6. */ -#if JERRY_ESNEXT ecma_object_t *new_array_p = ecma_op_array_species_create (obj_p, 0); if (JERRY_UNLIKELY (new_array_p == NULL)) @@ -2044,12 +1949,6 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn * /* ES11: 22.1.3.7. 7.c.iii.1 */ const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW; -#else /* !JERRY_ESNEXT */ - ecma_object_t *new_array_p = ecma_op_new_array_object (0); - - /* ES5.1: 15.4.4.20. 9.c.iii.1 */ - const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE; -#endif /* JERRY_ESNEXT */ /* We already checked that arg1 is callable, so it will always be an object. */ JERRY_ASSERT (ecma_is_value_object (arg1)); @@ -2092,7 +1991,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn * { ecma_value_t put_comp; put_comp = ecma_builtin_helper_def_prop_by_index (new_array_p, new_array_index, get_value, prop_flags); -#if JERRY_ESNEXT + if (ECMA_IS_VALUE_ERROR (put_comp)) { ecma_free_value (call_value); @@ -2101,9 +2000,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn * return put_comp; } -#else /* !JERRY_ESNEXT */ - JERRY_ASSERT (ecma_is_value_true (put_comp)); -#endif /* JERRY_ESNEXT */ + new_array_index++; } @@ -2235,8 +2132,6 @@ ecma_builtin_array_reduce_from (const ecma_value_t args_p[], /**< routine's argu return accumulator; } /* ecma_builtin_array_reduce_from */ -#if JERRY_ESNEXT - /** * The Array.prototype object's 'fill' routine * @@ -2852,7 +2747,6 @@ ecma_builtin_array_prototype_object_flat_map (ecma_value_t callback, /**< callba /* 6. */ return ecma_make_object_value (new_array_p); } /* ecma_builtin_array_prototype_object_flat_map */ -#endif /* JERRY_ESNEXT */ /** * Dispatcher of the built-in's routines @@ -2880,12 +2774,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< { ecma_value_t ret_value = ECMA_VALUE_EMPTY; -#if !JERRY_ESNEXT - if (builtin_routine_id == ECMA_ARRAY_PROTOTYPE_TO_STRING) - { - ret_value = ecma_array_object_to_string (obj_this); - } -#endif /* !JERRY_ESNEXT */ if (builtin_routine_id == ECMA_ARRAY_PROTOTYPE_SORT) { ret_value = ecma_builtin_array_prototype_object_sort (this_arg, arguments_list_p[0], obj_p); @@ -2899,7 +2787,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< return ret_value; } -#if JERRY_ESNEXT if (JERRY_UNLIKELY (builtin_routine_id >= ECMA_ARRAY_PROTOTYPE_ENTRIES && builtin_routine_id <= ECMA_ARRAY_PROTOTYPE_KEYS)) { @@ -2918,7 +2805,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< ecma_deref_object (obj_p); return ret_value; } -#endif /* JERRY_ESNEXT */ ecma_length_t length; ecma_value_t len_value = ecma_op_object_get_length (obj_p, &length); @@ -3019,7 +2905,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< length); break; } -#if JERRY_ESNEXT case ECMA_ARRAY_PROTOTYPE_COPY_WITHIN: { ret_value = ecma_builtin_array_prototype_object_copy_within (arguments_list_p, arguments_number, obj_p, length); @@ -3060,7 +2945,6 @@ ecma_builtin_array_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< ecma_builtin_array_prototype_object_flat_map (arguments_list_p[0], arguments_list_p[1], obj_p, length); break; } -#endif /* JERRY_ESNEXT */ default: { JERRY_ASSERT (builtin_routine_id == ECMA_ARRAY_PROTOTYPE_FILTER); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h index 4ca296af..19110f78 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h @@ -27,12 +27,10 @@ /* ECMA-262 v5, 15.4.4.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_ARRAY, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#if JERRY_ESNEXT /* ECMA-262 v6, 22.1.3.31 */ OBJECT_VALUE (LIT_GLOBAL_SYMBOL_UNSCOPABLES, ECMA_BUILTIN_ID_ARRAY_PROTOTYPE_UNSCOPABLES, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ /* Number properties: * (property name, object pointer getter) */ @@ -43,9 +41,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 0, ECMA_PROPERTY_FLAG_WRITABLE) /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ECMA_ARRAY_PROTOTYPE_TO_LOCALE_STRING, 0, 0) -#if !JERRY_ESNEXT -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_ARRAY_PROTOTYPE_TO_STRING, 0, 0) -#endif /* !JERRY_ESNEXT */ ROUTINE (LIT_MAGIC_STRING_CONCAT, ECMA_ARRAY_PROTOTYPE_CONCAT, NON_FIXED, 1) ROUTINE (LIT_MAGIC_STRING_JOIN, ECMA_ARRAY_PROTOTYPE_JOIN, 1, 1) ROUTINE (LIT_MAGIC_STRING_POP, ECMA_ARRAY_PROTOTYPE_POP, 0, 0) @@ -68,7 +63,6 @@ ROUTINE (LIT_MAGIC_STRING_FILTER, ECMA_ARRAY_PROTOTYPE_FILTER, 2, 1) /* Note these 2 routines must be in this order */ ROUTINE (LIT_MAGIC_STRING_REDUCE, ECMA_ARRAY_PROTOTYPE_REDUCE, 2, 1) ROUTINE (LIT_MAGIC_STRING_REDUCE_RIGHT_UL, ECMA_ARRAY_PROTOTYPE_REDUCE_RIGHT, 2, 1) -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_FIND, ECMA_ARRAY_PROTOTYPE_FIND, 2, 1) ROUTINE (LIT_MAGIC_STRING_FIND_INDEX, ECMA_ARRAY_PROTOTYPE_FIND_INDEX, 2, 1) ROUTINE (LIT_MAGIC_STRING_FILL, ECMA_ARRAY_PROTOTYPE_FILL, 3, 1) @@ -85,7 +79,6 @@ INTRINSIC_PROPERTY (LIT_MAGIC_STRING_VALUES, INTRINSIC_PROPERTY (LIT_GLOBAL_SYMBOL_ITERATOR, LIT_INTERNAL_MAGIC_STRING_ARRAY_PROTOTYPE_VALUES, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_ARRAY */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array.c index bfd782e8..2bf7c7b0 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array.c @@ -46,11 +46,9 @@ enum { ECMA_ARRAY_ROUTINE_START = 0, ECMA_ARRAY_ROUTINE_IS_ARRAY, -#if JERRY_ESNEXT ECMA_ARRAY_ROUTINE_FROM, ECMA_ARRAY_ROUTINE_OF, ECMA_ARRAY_ROUTINE_SPECIES_GET -#endif /* JERRY_ESNEXT */ }; #define BUILTIN_INC_HEADER_NAME "ecma-builtin-array.inc.h" @@ -67,7 +65,6 @@ enum * @{ */ -#if JERRY_ESNEXT /** * The Array object's 'from' routine * @@ -458,8 +455,6 @@ ecma_builtin_array_object_of (ecma_value_t this_arg, /**< 'this' argument */ return ecma_make_object_value (obj_p); } /* ecma_builtin_array_object_of */ -#endif /* JERRY_ESNEXT */ - /** * Handle calling [[Call]] of built-in Array object * @@ -500,9 +495,6 @@ ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /** { JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); -#if !JERRY_ESNEXT - return ecma_builtin_array_dispatch_call (arguments_list_p, arguments_list_len); -#else /* JERRY_ESNEXT */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_ARRAY_PROTOTYPE); @@ -523,7 +515,6 @@ ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /** ECMA_SET_NON_NULL_POINTER (object_p->u2.prototype_cp, proto_p); ecma_deref_object (proto_p); return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_array_dispatch_construct */ /** @@ -549,7 +540,6 @@ ecma_builtin_array_dispatch_routine (uint8_t builtin_routine_id, /**< built-in w return ecma_is_value_array (arguments_list_p[0]); } -#if JERRY_ESNEXT case ECMA_ARRAY_ROUTINE_FROM: { return ecma_builtin_array_object_from (this_arg, arguments_list_p, arguments_number); @@ -562,7 +552,6 @@ ecma_builtin_array_dispatch_routine (uint8_t builtin_routine_id, /**< built-in w { return ecma_copy_value (this_arg); } -#endif /* JERRY_ESNEXT */ default: { JERRY_UNREACHABLE (); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h index 19f8b731..bf43da90 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h @@ -31,21 +31,16 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_ARRAY_PROTOTYPE, ECMA_ * (property name, object pointer getter) */ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_ARRAY_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_IS_ARRAY_UL, ECMA_ARRAY_ROUTINE_IS_ARRAY, 1, 1) -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_FROM, ECMA_ARRAY_ROUTINE_FROM, NON_FIXED, 1) ROUTINE (LIT_MAGIC_STRING_OF, ECMA_ARRAY_ROUTINE_OF, NON_FIXED, 0) /* ECMA-262 v6, 22.1.2.5 */ ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES, ECMA_ARRAY_ROUTINE_SPECIES_GET, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* !(JERRY_BUILTIN_ARRAY) */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c index 034df504..43308c86 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.c @@ -33,8 +33,6 @@ #include "opcodes.h" #include "vm-defines.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -64,7 +62,7 @@ enum * \addtogroup ecmabuiltins * @{ * - * \addtogroup generator ECMA %AsyncFromSyncIteratorPrototype% object built-in + * \addtogroup asyncfromsynciteratorprototype ECMA %AsyncFromSyncIteratorPrototype% object built-in * @{ */ @@ -355,5 +353,3 @@ ecma_builtin_async_from_sync_iterator_prototype_dispatch_routine (uint8_t builti * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h index c1413fcb..7c5e9c39 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-from-sync-iterator-prototype.inc.h @@ -19,14 +19,10 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_ROUTINE_NEXT, 1, 1) ROUTINE (LIT_MAGIC_STRING_RETURN, ECMA_ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_ROUTINE_RETURN, 1, 1) ROUTINE (LIT_MAGIC_STRING_THROW, ECMA_ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_ROUTINE_THROW, 1, 1) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c index 150bb953..6be0c162 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.c @@ -15,8 +15,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -39,5 +37,3 @@ * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h index 32e3cfae..e4388d3c 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function-prototype.inc.h @@ -19,14 +19,10 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* ECMA-262 v11, 25.7.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_ASYNC_FUNCTION, ECMA_PROPERTY_FLAG_CONFIGURABLE) /* ECMA-262 v11, 25.7.3.2 */ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_ASYNC_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c index 115af43c..de1a7dbc 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.c @@ -15,8 +15,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" #include "ecma-function-object.h" @@ -68,5 +66,3 @@ ecma_builtin_async_function_dispatch_construct (const ecma_value_t *arguments_li * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h index fb96a002..0fe50ae2 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-function.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* ECMA-262 v11, 25.7.2 */ STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_ASYNC_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) @@ -33,6 +31,4 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_ASYNC_FUNCTION_PROTOTY /* ECMA-262 v11, 25.7.3.2 */ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_ASYNC_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c index ad2fcd67..34d442f7 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.c @@ -15,8 +15,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" #include "ecma-function-object.h" @@ -31,7 +29,7 @@ * \addtogroup ecmabuiltins * @{ * - * \addtogroup asyncgenerator ECMA AsyncGeneratorFunction object built-in + * \addtogroup asyncgeneratorfunction ECMA AsyncGeneratorFunction object built-in * @{ */ @@ -70,5 +68,3 @@ ecma_builtin_async_generator_function_dispatch_construct (const ecma_value_t *ar * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h index 40914c49..edc88c71 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-function.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* ECMA-262 v10, 25.3.2 */ STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_ASYNC_GENERATOR_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) @@ -30,6 +28,4 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_CONFIGURABLE) /* ECMA-262 v6, 25.3.2.2 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_ASYNC_GENERATOR, ECMA_PROPERTY_FIXED) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c index fb0d84c8..474bd877 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.c @@ -26,8 +26,6 @@ #include "opcodes.h" #include "vm-defines.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -57,12 +55,12 @@ enum * \addtogroup ecmabuiltins * @{ * - * \addtogroup asyncgenerator ECMA AsyncGenerator.prototype object built-in + * \addtogroup asyncgeneratorprototype ECMA AsyncGenerator.prototype object built-in * @{ */ /** - * Convert routine type to operation type.. + * Convert routine type to operation type. */ #define ECMA_ASYNC_GENERATOR_ROUTINE_TO_OPERATION(type) \ ((ecma_async_generator_operation_type_t) ((type) -ECMA_ASYNC_GENERATOR_PROTOTYPE_ROUTINE_NEXT)) @@ -150,5 +148,3 @@ ecma_builtin_async_generator_prototype_dispatch_routine (uint8_t builtin_routine * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h index 481c097d..dcad1c62 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator-prototype.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Object properties: * (property name, object pointer getter) */ @@ -36,6 +34,4 @@ ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_ASYNC_GENERATOR_PROTOTYPE_ROUTINE_NEXT, 1, ROUTINE (LIT_MAGIC_STRING_RETURN, ECMA_ASYNC_GENERATOR_PROTOTYPE_ROUTINE_RETURN, 1, 1) ROUTINE (LIT_MAGIC_STRING_THROW, ECMA_ASYNC_GENERATOR_PROTOTYPE_ROUTINE_THROW, 1, 1) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c index 2f5651b1..46937420 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.c @@ -15,8 +15,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -39,5 +37,3 @@ * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h index 076e42cc..a856cbbe 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-generator.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* ECMA-262 v6, 25.3.2.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_ASYNC_GENERATOR_FUNCTION, ECMA_PROPERTY_FLAG_CONFIGURABLE) @@ -32,6 +30,4 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_ASYNC_GENERATOR_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c index ec65c765..28579fee 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.c @@ -17,8 +17,6 @@ #include "ecma-builtins.h" #include "ecma-iterator-object.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -103,5 +101,3 @@ ecma_builtin_async_iterator_prototype_dispatch_routine (uint8_t builtin_routine_ * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h index 4a0cb720..53d43d00 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-async-iterator-prototype.inc.h @@ -19,12 +19,8 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_GLOBAL_SYMBOL_ASYNC_ITERATOR, ECMA_BUILTIN_ASYNC_ITERATOR_PROTOTYPE_OBJECT_ASYNC_ITERATOR, 0, 0) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h index 51e0c298..36f68455 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h @@ -31,10 +31,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE, ECM * (property name, object pointer getter) */ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_BOOLEAN_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_BOOLEAN */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c index 082273e8..5ad4f2d8 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c @@ -92,9 +92,6 @@ enum ECMA_DATE_PROTOTYPE_TO_STRING, /* ECMA-262 v5, 15.9.5.2 */ ECMA_DATE_PROTOTYPE_TO_DATE_STRING, /* ECMA-262 v5, 15.9.5.3 */ -#if !JERRY_ESNEXT - ECMA_DATE_PROTOTYPE_TO_UTC_STRING, /* ECMA-262 v5, 15.9.5.42 */ -#endif /* JERRY_ESNEXT */ ECMA_DATE_PROTOTYPE_TO_TIME_STRING, /* ECMA-262 v5, 15.9.5.4 */ ECMA_DATE_PROTOTYPE_TO_ISO_STRING, /* ECMA-262 v5, 15.9.5.43 */ @@ -102,9 +99,7 @@ enum ECMA_DATE_PROTOTYPE_SET_TIME, /* ECMA-262 v5, 15.9.5.27 */ ECMA_DATE_PROTOTYPE_TO_JSON, /* ECMA-262 v5, 15.9.5.44 */ -#if JERRY_ESNEXT ECMA_DATE_PROTOTYPE_TO_PRIMITIVE, /* ECMA-262 v6 20.3.4.45 */ -#endif /* JERRY_ESNEXT */ }; #define BUILTIN_INC_HEADER_NAME "ecma-builtin-date-prototype.inc.h" @@ -178,7 +173,6 @@ ecma_builtin_date_prototype_to_json (ecma_value_t this_arg) /**< this argument * return ret_value; } /* ecma_builtin_date_prototype_to_json */ -#if JERRY_ESNEXT /** * The Date.prototype object's toPrimitive routine * @@ -216,7 +210,6 @@ ecma_builtin_date_prototype_to_primitive (ecma_value_t this_arg, /**< this argum return ecma_raise_type_error (ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE); } /* ecma_builtin_date_prototype_to_primitive */ -#endif /* JERRY_ESNEXT */ /** * Dispatch get date functions @@ -400,28 +393,20 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil } } -#if JERRY_ESNEXT ecma_date_object_t *date_object_p = (ecma_date_object_t *) object_p; ecma_number_t *date_value_p = &date_object_p->date_value; -#else /* !JERRY_ESNEXT */ - ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p; - ecma_number_t *date_value_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.cls.u3.date); -#endif /* JERRY_ESNEXT */ - ecma_number_t date_value = *date_value_p; if (!BUILTIN_DATE_FUNCTION_IS_UTC (builtin_routine_id)) { ecma_number_t local_tza; -#if JERRY_ESNEXT if (date_object_p->header.u.cls.u1.date_flags & ECMA_DATE_TZA_SET) { local_tza = date_object_p->header.u.cls.u3.tza; JERRY_ASSERT (local_tza == ecma_date_local_time_zone_adjustment (date_value)); } else -#endif /* JERRY_ESNEXT */ { local_tza = ecma_date_local_time_zone_adjustment (date_value); } @@ -472,9 +457,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil if (ecma_number_is_nan (converted_number[0])) { *date_value_p = converted_number[0]; -#if JERRY_ESNEXT date_object_p->header.u.cls.u1.date_flags &= (uint8_t) ~ECMA_DATE_TZA_SET; -#endif /* JERRY_ESNEXT */ return ecma_make_number_value (converted_number[0]); } @@ -603,9 +586,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil *date_value_p = full_date; -#if JERRY_ESNEXT date_object_p->header.u.cls.u1.date_flags &= (uint8_t) ~ECMA_DATE_TZA_SET; -#endif /* JERRY_ESNEXT */ return ecma_make_number_value (full_date); } /* ecma_builtin_date_prototype_dispatch_set */ @@ -631,12 +612,10 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b return ecma_builtin_date_prototype_to_json (this_arg); } -#if JERRY_ESNEXT if (JERRY_UNLIKELY (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_PRIMITIVE)) { return ecma_builtin_date_prototype_to_primitive (this_arg, arguments_list[0]); } -#endif /* JERRY_ESNEXT */ if (!ecma_is_value_object (this_arg) || !ecma_object_class_is (ecma_get_object_from_value (this_arg), ECMA_OBJECT_CLASS_DATE)) @@ -646,14 +625,8 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b ecma_object_t *this_obj_p = ecma_get_object_from_value (this_arg); -#if JERRY_ESNEXT ecma_date_object_t *date_object_p = (ecma_date_object_t *) this_obj_p; ecma_number_t *date_value_p = &date_object_p->date_value; -#else /* JERRY_ESNEXT */ - ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) this_obj_p; - ecma_number_t *date_value_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.cls.u3.date); -#endif /* JERRY_ESNEXT */ - ecma_number_t date_value = *date_value_p; if (builtin_routine_id == ECMA_DATE_PROTOTYPE_GET_TIME) @@ -671,9 +644,7 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b } *date_value_p = ecma_date_time_clip (time_num); -#if JERRY_ESNEXT date_object_p->header.u.cls.u1.date_flags &= (uint8_t) ~ECMA_DATE_TZA_SET; -#endif /* JERRY_ESNEXT */ return ecma_make_number_value (*date_value_p); } @@ -685,7 +656,7 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b if (!BUILTIN_DATE_FUNCTION_IS_UTC (builtin_routine_id)) { ecma_number_t local_tza; -#if JERRY_ESNEXT + if (date_object_p->header.u.cls.u1.date_flags & ECMA_DATE_TZA_SET) { local_tza = date_object_p->header.u.cls.u3.tza; @@ -693,14 +664,11 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b } else { -#endif /* JERRY_ESNEXT */ local_tza = ecma_date_local_time_zone_adjustment (date_value); -#if JERRY_ESNEXT JERRY_ASSERT (local_tza <= INT32_MAX && local_tza >= INT32_MIN); date_object_p->header.u.cls.u3.tza = (int32_t) local_tza; date_object_p->header.u.cls.u1.date_flags |= ECMA_DATE_TZA_SET; } -#endif /* JERRY_ESNEXT */ date_value += local_tza; } @@ -736,12 +704,6 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b { return ecma_date_value_to_date_string (date_value); } -#if !JERRY_ESNEXT - case ECMA_DATE_PROTOTYPE_TO_UTC_STRING: - { - return ecma_date_value_to_utc_string (date_value); - } -#endif /* JERRY_ESNEXT */ default: { JERRY_ASSERT (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_TIME_STRING); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h index ff4f9a20..a960cc45 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h @@ -65,7 +65,6 @@ ROUTINE (LIT_MAGIC_STRING_SET_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_FULL_YEAR, N ROUTINE (LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR, NON_FIXED, 3) ROUTINE (LIT_MAGIC_STRING_TO_ISO_STRING_UL, ECMA_DATE_PROTOTYPE_TO_ISO_STRING, 0, 0) ROUTINE (LIT_MAGIC_STRING_TO_JSON_UL, ECMA_DATE_PROTOTYPE_TO_JSON, 1, 1) -#if JERRY_ESNEXT ROUTINE_CONFIGURABLE_ONLY (LIT_GLOBAL_SYMBOL_TO_PRIMITIVE, ECMA_DATE_PROTOTYPE_TO_PRIMITIVE, 1, 1) INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TO_UTC_STRING_UL, LIT_MAGIC_STRING_TO_UTC_STRING_UL, @@ -74,16 +73,6 @@ INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TO_UTC_STRING_UL, INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TO_GMT_STRING_UL, LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* JERRY_BUILTIN_ANNEXB */ -#else /* !JERRY_ESNEXT */ -ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0) -#if JERRY_BUILTIN_ANNEXB -ROUTINE (LIT_MAGIC_STRING_TO_GMT_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0) -#endif /* JERRY_BUILTIN_ANNEXB */ -#endif /* !JERRY_ESNEXT */ - -#if JERRY_BUILTIN_ANNEXB - ROUTINE (LIT_MAGIC_STRING_GET_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_YEAR, 0, 0) ROUTINE (LIT_MAGIC_STRING_SET_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_YEAR, 1, 1) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date.c b/jerry-core/ecma/builtin-objects/ecma-builtin-date.c index af90c7a1..201634d9 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-date.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date.c @@ -669,13 +669,7 @@ static ecma_value_t ecma_builtin_date_utc (const ecma_value_t args[], /**< arguments list */ uint32_t args_number) /**< number of arguments */ { -#if JERRY_ESNEXT - const uint32_t required_args_number = 1; -#else /* !JERRY_ESNEXT */ - const uint32_t required_args_number = 2; -#endif /* JERRY_ESNEXT */ - - if (args_number < required_args_number) + if (args_number < 1) { return ecma_make_nan_value (); } @@ -712,7 +706,6 @@ ecma_builtin_date_now_helper (void) static ecma_value_t ecma_builtin_date_create (ecma_number_t tv) { -#if JERRY_ESNEXT JERRY_ASSERT (JERRY_CONTEXT (current_new_target_p) != NULL); ecma_object_t *prototype_obj_p = @@ -731,17 +724,6 @@ ecma_builtin_date_create (ecma_number_t tv) date_object_p->header.u.cls.u1.date_flags = ECMA_DATE_TZA_NONE; date_object_p->header.u.cls.u3.tza = 0; date_object_p->date_value = tv; -#else /* !JERRY_ESNEXT */ - ecma_number_t *date_value_p = ecma_alloc_number (); - *date_value_p = tv; - - ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_DATE_PROTOTYPE); - ecma_object_t *obj_p = ecma_create_object (prototype_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS); - - ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p; - ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_DATE; - ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.cls.u3.date, date_value_p); -#endif /* JERRY_ESNEXT */ return ecma_make_object_value (obj_p); } /* ecma_builtin_date_create */ @@ -793,14 +775,7 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**< if (ecma_is_value_object (argument) && ecma_object_class_is (ecma_get_object_from_value (argument), ECMA_OBJECT_CLASS_DATE)) { -#if JERRY_ESNEXT - tv = ((ecma_date_object_t *) ecma_get_object_from_value (argument))->date_value; -#else /* !JERRY_ESNEXT */ - ecma_extended_object_t *arg_ext_object_p = (ecma_extended_object_t *) ecma_get_object_from_value (argument); - tv = *ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, arg_ext_object_p->u.cls.u3.date); -#endif /* JERRY_ESNEXT */ - - return ecma_builtin_date_create (tv); + return ecma_builtin_date_create (((ecma_date_object_t *) ecma_get_object_from_value (argument))->date_value); } /* 4.b */ ecma_value_t primitive = ecma_op_to_primitive (argument, ECMA_PREFERRED_TYPE_NO); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h index f390e0dd..a50ac00f 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h @@ -30,9 +30,7 @@ ROUTINE (LIT_MAGIC_STRING_PARSE, ECMA_DATE_ROUTINE_PARSE, 1, 1) ROUTINE (LIT_MAGIC_STRING_UTC_U, ECMA_DATE_ROUTINE_UTC, NON_FIXED, 7) ROUTINE (LIT_MAGIC_STRING_NOW, ECMA_DATE_ROUTINE_NOW, 0, 0) -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_DATE_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_DATE */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-error.c b/jerry-core/ecma/builtin-objects/ecma-builtin-error.c index 1f8dedda..846186a1 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-error.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-error.c @@ -65,9 +65,6 @@ ecma_value_t ecma_builtin_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ uint32_t arguments_list_len) /**< number of arguments */ { -#if !JERRY_ESNEXT - return ecma_builtin_error_dispatch_call (arguments_list_p, arguments_list_len); -#else /* JERRY_ESNEXT */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_ERROR_PROTOTYPE); @@ -87,7 +84,6 @@ ecma_builtin_error_dispatch_construct (const ecma_value_t *arguments_list_p, /** ecma_deref_object (proto_p); return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_error_dispatch_construct */ /** diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h index 7098dd95..d8cff1bd 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h @@ -30,8 +30,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.7.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED) -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c index 3804420d..341d179b 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c @@ -67,9 +67,6 @@ ecma_value_t ecma_builtin_eval_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ uint32_t arguments_list_len) /**< number of arguments */ { -#if !JERRY_ESNEXT - return ecma_builtin_eval_error_dispatch_call (arguments_list_p, arguments_list_len); -#else /* JERRY_ESNEXT */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE); @@ -89,7 +86,6 @@ ecma_builtin_eval_error_dispatch_construct (const ecma_value_t *arguments_list_p ecma_deref_object (proto_p); return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_eval_error_dispatch_construct */ /** 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 9efa35f6..29c8f966 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h @@ -32,9 +32,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.11.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED) -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_EVAL_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_ERRORS */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c index 8910eaaa..e7f0b1f9 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c @@ -48,9 +48,7 @@ enum ECMA_FUNCTION_PROTOTYPE_CALL, ECMA_FUNCTION_PROTOTYPE_APPLY, ECMA_FUNCTION_PROTOTYPE_BIND, -#if JERRY_ESNEXT ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE, -#endif /* JERRY_ESNEXT */ }; #define BUILTIN_INC_HEADER_NAME "ecma-builtin-function-prototype.inc.h" @@ -103,12 +101,10 @@ ecma_builtin_function_prototype_object_to_string (ecma_object_t *func_obj_p) /** if (extended_info & CBC_EXTENDED_CODE_FLAGS_HAS_SOURCE_CODE_RANGE) { -#if JERRY_ESNEXT if (extended_info & CBC_EXTENDED_CODE_FLAGS_HAS_ARGUMENT_LENGTH) { ecma_extended_info_decode_vlq (&extended_info_p); } -#endif /* JERRY_ESNEXT */ uint32_t range_start = ecma_extended_info_decode_vlq (&extended_info_p); uint32_t range_size = ecma_extended_info_decode_vlq (&extended_info_p); @@ -159,7 +155,6 @@ ecma_builtin_function_prototype_object_to_string (ecma_object_t *func_obj_p) /** lit_magic_string_id_t header_id = LIT_MAGIC_STRING_FUNCTION_TO_STRING_ANON; -#if JERRY_ESNEXT switch (CBC_FUNCTION_GET_TYPE (bytecode_p->status_flags)) { case CBC_FUNCTION_GENERATOR: @@ -178,7 +173,6 @@ ecma_builtin_function_prototype_object_to_string (ecma_object_t *func_obj_p) /** break; } } -#endif /* JERRY_ESNEXT */ ecma_stringbuilder_t builder = ecma_stringbuilder_create_from (ecma_get_magic_string (header_id)); ecma_value_t function_arguments = CBC_SCRIPT_GET_FUNCTION_ARGUMENTS (script_p, script_p->refs_and_type); @@ -314,9 +308,6 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p, /**< /* 4. 11. 18. */ ecma_object_t *prototype_obj_p; -#if !JERRY_ESNEXT - prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE); -#else /* JERRY_ESNEXT */ #if JERRY_BUILTIN_PROXY if (ECMA_OBJECT_IS_PROXY (this_arg_obj_p)) { @@ -344,7 +335,6 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p, /**< #if JERRY_BUILTIN_PROXY } #endif /* JERRY_BUILTIN_PROXY */ -#endif /* !JERRY_ESNEXT */ ecma_object_t *function_p; ecma_bound_function_t *bound_func_p; @@ -390,7 +380,6 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p, /**< bound_func_p->header.u.bound_function.args_len_or_this = args_len_or_this; } -#if JERRY_ESNEXT if (prototype_obj_p != NULL) { ecma_deref_object (prototype_obj_p); @@ -461,7 +450,6 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p, /**< NULL); name_prop_value_p->value = bound_function_name; -#endif /* JERRY_ESNEXT */ /* * [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_FUNCTION type. @@ -516,12 +504,10 @@ ecma_builtin_function_prototype_dispatch_routine (uint8_t builtin_routine_id, /* { if (!ecma_op_is_callable (this_arg)) { -#if JERRY_ESNEXT if (JERRY_UNLIKELY (builtin_routine_id == ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE)) { return ECMA_VALUE_FALSE; } -#endif /* JERRY_ESNEXT */ return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_FUNCTION); } @@ -546,12 +532,10 @@ ecma_builtin_function_prototype_dispatch_routine (uint8_t builtin_routine_id, /* { return ecma_builtin_function_prototype_object_bind (func_obj_p, arguments_list_p, arguments_number); } -#if JERRY_ESNEXT case ECMA_FUNCTION_PROTOTYPE_SYMBOL_HAS_INSTANCE: { return ecma_op_object_has_instance (func_obj_p, arguments_list_p[0]); } -#endif /* JERRY_ESNEXT */ default: { JERRY_UNREACHABLE (); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h index 46261d2d..8bab444f 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h @@ -29,10 +29,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_FUNCTION, ECMA_PROPE * (property name, object pointer getter) */ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 0, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING__EMPTY, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ @@ -41,7 +38,6 @@ ROUTINE (LIT_MAGIC_STRING_APPLY, ECMA_FUNCTION_PROTOTYPE_APPLY, 2, 2) ROUTINE (LIT_MAGIC_STRING_CALL, ECMA_FUNCTION_PROTOTYPE_CALL, NON_FIXED, 1) ROUTINE (LIT_MAGIC_STRING_BIND, ECMA_FUNCTION_PROTOTYPE_BIND, NON_FIXED, 1) -#if JERRY_ESNEXT /** * ECMA-262 v6.0 19.2.3.6 @@hasInstance * the property attributes are: { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. @@ -55,6 +51,5 @@ ACCESSOR_BUILTIN_FUNCTION (LIT_MAGIC_STRING_CALLER, ECMA_BUILTIN_ID_TYPE_ERROR_THROWER, ECMA_BUILTIN_ID_TYPE_ERROR_THROWER, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h index 388755de..92e50eda 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h @@ -29,9 +29,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, EC * (property name, object pointer getter) */ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c index 14907dd1..acb25eec 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c @@ -15,8 +15,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" #include "ecma-function-object.h" @@ -31,7 +29,7 @@ * \addtogroup ecmabuiltins * @{ * - * \addtogroup generator ECMA GeneratorFunction object built-in + * \addtogroup generatorfunction ECMA GeneratorFunction object built-in * @{ */ @@ -68,5 +66,3 @@ ecma_builtin_generator_function_dispatch_construct (const ecma_value_t *argument * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h index a6d60bdc..39416a91 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* ECMA-262 v6, 25.2.2 */ STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) @@ -30,6 +28,4 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_CONFIGURABLE) /* ECMA-262 v6, 25.2.2.2 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_GENERATOR, ECMA_PROPERTY_FIXED) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c index 703f6e1d..15afb4d1 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c @@ -24,8 +24,6 @@ #include "opcodes.h" #include "vm-defines.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -55,12 +53,12 @@ enum * \addtogroup ecmabuiltins * @{ * - * \addtogroup generator ECMA Generator.prototype object built-in + * \addtogroup generatorprototype ECMA Generator.prototype object built-in * @{ */ /** - * Convert routine type to operation type.. + * Convert routine type to operation type. */ #define ECMA_GENERATOR_ROUTINE_TO_OPERATION(type) \ ((ecma_iterator_command_type_t) ((type) -ECMA_GENERATOR_PROTOTYPE_ROUTINE_NEXT)) @@ -252,5 +250,3 @@ ecma_builtin_generator_prototype_dispatch_routine (uint8_t builtin_routine_id, / * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h index 4028b4e8..07086dbd 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Object properties: * (property name, object pointer getter) */ @@ -36,6 +34,4 @@ ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_GENERATOR_PROTOTYPE_ROUTINE_NEXT, 1, 1) ROUTINE (LIT_MAGIC_STRING_RETURN, ECMA_GENERATOR_PROTOTYPE_ROUTINE_RETURN, 1, 1) ROUTINE (LIT_MAGIC_STRING_THROW, ECMA_GENERATOR_PROTOTYPE_ROUTINE_THROW, 1, 1) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c b/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c index 29045609..6d822933 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c @@ -15,8 +15,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -39,5 +37,3 @@ * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h index bf3fc2f5..b45bd937 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-generator.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* ECMA-262 v6, 25.3.2.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_GENERATOR_FUNCTION, ECMA_PROPERTY_FLAG_CONFIGURABLE) @@ -30,6 +28,4 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_GENERATOR_PROTOTYPE, E /* ECMA-262 v6, 25.3.2.3.3 */ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c index 6cc44663..d9ccc8ff 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c @@ -100,12 +100,10 @@ ecma_builtin_global_object_eval (ecma_value_t x) /**< routine's first argument * parse_opts |= ECMA_PARSE_STRICT_MODE; } -#if JERRY_ESNEXT if (vm_is_direct_eval_form_call ()) { parse_opts |= ECMA_GET_LOCAL_PARSE_OPTS (); } -#endif /* JERRY_ESNEXT */ /* steps 2 to 8 */ return ecma_op_eval (x, parse_opts); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h index 6048dfd4..e0b02698 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h @@ -173,14 +173,12 @@ OBJECT_VALUE (LIT_MAGIC_STRING_WEAKMAP_UL, ECMA_BUILTIN_ID_WEAKMAP, ECMA_PROPERT OBJECT_VALUE (LIT_MAGIC_STRING_WEAKREF_UL, ECMA_BUILTIN_ID_WEAKREF, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) #endif /* JERRY_BUILTIN_WEAKREF */ -#if JERRY_ESNEXT OBJECT_VALUE (LIT_MAGIC_STRING_AGGREGATE_ERROR_UL, ECMA_BUILTIN_ID_AGGREGATE_ERROR, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) OBJECT_VALUE (LIT_MAGIC_STRING_PROMISE_UL, ECMA_BUILTIN_ID_PROMISE, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) /* ECMA-262 v6, 19.4.1.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_SYMBOL_UL, ECMA_BUILTIN_ID_SYMBOL, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_GLOBAL_THIS /* ECMA-262 v11, 18.1.1 */ @@ -212,14 +210,10 @@ ROUTINE (LIT_MAGIC_STRING_DECODE_URI, ECMA_GLOBAL_DECODE_URI, 1, 1) ROUTINE (LIT_MAGIC_STRING_DECODE_URI_COMPONENT, ECMA_GLOBAL_DECODE_URI_COMPONENT, 1, 1) ROUTINE (LIT_MAGIC_STRING_ENCODE_URI, ECMA_GLOBAL_ENCODE_URI, 1, 1) ROUTINE (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, ECMA_GLOBAL_ENCODE_URI_COMPONENT, 1, 1) -#if JERRY_ESNEXT + INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_FLOAT, LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_INT, LIT_MAGIC_STRING_PARSE_INT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#else /* !JERRY_ESNEXT */ -ROUTINE (LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_GLOBAL_PARSE_FLOAT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ECMA_GLOBAL_PARSE_INT, 2, 2) -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_ANNEXB ROUTINE (LIT_MAGIC_STRING_ESCAPE, ECMA_GLOBAL_ESCAPE, 1, 1) ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ECMA_GLOBAL_UNESCAPE, 1, 1) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c b/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c index d727f026..3a048d22 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.c @@ -13,24 +13,26 @@ * limitations under the License. */ -#include "ecma-globals.h" - -#if JERRY_ESNEXT - #include "ecma-builtin-handlers.h" + +#include "ecma-globals.h" #include "ecma-iterator-object.h" #include "ecma-promise-object.h" static const ecma_builtin_handler_t ecma_native_handlers[] = { +/** @cond doxygen_suppress */ #define ECMA_NATIVE_HANDLER(id, handler, length) handler, #include "ecma-builtin-handlers.inc.h" #undef ECMA_NATIVE_HANDLER + /** @endcond */ }; static const uint8_t ecma_native_handler_lengths[] = { +/** @cond doxygen_suppress */ #define ECMA_NATIVE_HANDLER(id, handler, length) length, #include "ecma-builtin-handlers.inc.h" #undef ECMA_NATIVE_HANDLER + /** @endcond */ }; /** @@ -56,5 +58,3 @@ ecma_builtin_handler_get_length (ecma_native_handler_id_t id) /**< handler id */ JERRY_ASSERT (id != ECMA_NATIVE_HANDLER_START && id < ECMA_NATIVE_HANDLER__COUNT); return ecma_native_handler_lengths[id - 1]; } /* ecma_builtin_handler_get_length */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h b/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h index 21e96311..01434739 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-handlers.h @@ -16,22 +16,21 @@ #ifndef ECMA_BUILTIN_HANDLERS_H #define ECMA_BUILTIN_HANDLERS_H -#include "ecma-globals.h" - -#if JERRY_ESNEXT - #include "ecma-builtins.h" +#include "ecma-globals.h" #include "ecma-helpers.h" #include "ecma-promise-object.h" #include "ecma-proxy-object.h" typedef enum { + /** @cond doxygen_suppress */ ECMA_NATIVE_HANDLER_START = 0, #define ECMA_NATIVE_HANDLER(id, handler, length) id, #include "ecma-builtin-handlers.inc.h" #undef ECMA_NATIVE_HANDLER ECMA_NATIVE_HANDLER__COUNT + /** @endcond */ } ecma_native_handler_id_t; typedef enum @@ -49,6 +48,4 @@ typedef enum ecma_builtin_handler_t ecma_builtin_handler_get (ecma_native_handler_id_t id); uint8_t ecma_builtin_handler_get_length (ecma_native_handler_id_t id); -#endif /* JERRY_ESNEXT */ - #endif /* !ECMA_BUILTIN_HANDLERS_H */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h index 94cf6801..cbd81c69 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h @@ -25,7 +25,6 @@ #define STRING_VALUE(name, magic_string_id, prop_attributes) #endif /* !STRING_VALUE */ -#if JERRY_ESNEXT #ifndef SYMBOL_VALUE #define SYMBOL_VALUE(symbol, desc_magic_string_id) #endif /* !SYMBOL_VALUE */ @@ -37,7 +36,6 @@ #ifndef ACCESSOR_BUILTIN_FUNCTION_OBJECT #define ACCESSOR_BUILTIN_FUNCTION_OBJECT(name, getter_builtin_id, setter_builtin_id, prop_attributes) #endif /* !ACCESSOR_BUILTIN_FUNCTION_OBJECT */ -#endif /* JERRY_ESNEXT */ #ifndef OBJECT_VALUE #define OBJECT_VALUE(name, obj_builtin_id, prop_attributes) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h index 951c5fb4..3d053c5d 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h @@ -16,11 +16,9 @@ #undef SIMPLE_VALUE #undef NUMBER_VALUE #undef STRING_VALUE -#if JERRY_ESNEXT #undef SYMBOL_VALUE #undef INTRINSIC_PROPERTY #undef ACCESSOR_BUILTIN_FUNCTION_OBJECT -#endif /* JERRY_ESNEXT */ #undef OBJECT_VALUE #undef ROUTINE #undef ROUTINE_CONFIGURABLE_ONLY diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c index 90104af4..e298fad4 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c @@ -37,7 +37,6 @@ * @{ */ -#if JERRY_ESNEXT /** * Helper function for Object.prototype.toString routine when * the @@toStringTag property is present @@ -100,7 +99,6 @@ ecma_builtin_helper_object_to_string_tag_helper (ecma_value_t tag_value) /**< st return ecma_make_string_value (ret_string_p); } /* ecma_builtin_helper_object_to_string_tag_helper */ -#endif /* JERRY_ESNEXT */ /** * Common implementation of the Object.prototype.toString routine @@ -144,7 +142,6 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg builtin_tag = ecma_object_get_class_name (obj_p); -#if JERRY_ESNEXT ecma_value_t is_array = ecma_is_value_array (obj_this); if (ECMA_IS_VALUE_ERROR (is_array)) @@ -181,8 +178,6 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg } ecma_free_value (tag); -#endif /* JERRY_ESNEXT */ - ecma_deref_object (obj_p); } @@ -260,7 +255,6 @@ ecma_builtin_helper_array_index_normalize (ecma_value_t arg, /**< index */ ecma_length_t length, /**< array's length */ ecma_length_t *number_p) /**< [out] ecma_length_t */ { -#if JERRY_ESNEXT ecma_number_t to_int; if (ECMA_IS_VALUE_ERROR (ecma_op_to_integer (arg, &to_int))) @@ -272,9 +266,6 @@ ecma_builtin_helper_array_index_normalize (ecma_value_t arg, /**< index */ : (ecma_length_t) JERRY_MIN (to_int, (ecma_number_t) length)); return ECMA_VALUE_EMPTY; -#else /* !JERRY_ESNEXT */ - return ecma_builtin_helper_uint32_index_normalize (arg, length, number_p); -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_helper_array_index_normalize */ /** @@ -336,7 +327,6 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array * ecma_value_t value) /**< value to concat */ { /* 5.b */ -#if JERRY_ESNEXT ecma_value_t is_spreadable = ecma_op_is_concat_spreadable (value); if (ECMA_IS_VALUE_ERROR (is_spreadable)) @@ -347,17 +337,11 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array * bool spread_object = is_spreadable == ECMA_VALUE_TRUE; /* ES11: 22.1.3.1.5.c.iv.3.b */ const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | JERRY_PROP_SHOULD_THROW; -#else /* !JERRY_ESNEXT */ - /* ES5.1: 15.4.4.4.5.b.iii.3.b */ - const uint32_t prop_flags = ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE; - bool spread_object = ecma_is_value_true (ecma_is_value_array (value)); -#endif /* JERRY_ESNEXT */ if (spread_object) { ecma_object_t *obj_p = ecma_get_object_from_value (value); -#if JERRY_ESNEXT ecma_length_t arg_len; ecma_value_t error = ecma_op_object_get_length (obj_p, &arg_len); @@ -371,10 +355,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array * { return ecma_raise_type_error (ECMA_ERR_INVALID_ARRAY_LENGTH); } -#else /* !JERRY_ESNEXT */ - /* 5.b.ii */ - uint32_t arg_len = ecma_array_get_length (obj_p); -#endif /* JERRY_ESNEXT */ + /* 5.b.iii */ for (ecma_length_t array_index = 0; array_index < arg_len; array_index++) { @@ -396,14 +377,11 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array * ecma_value_t put_comp = ecma_builtin_helper_def_prop_by_index (array_obj_p, *length_p + array_index, get_value, prop_flags); ecma_free_value (get_value); -#if JERRY_ESNEXT + if (ECMA_IS_VALUE_ERROR (put_comp)) { return put_comp; } -#else /* !JERRY_ESNEXT */ - JERRY_ASSERT (ecma_is_value_true (put_comp)); -#endif /* JERRY_ESNEXT */ } *length_p += arg_len; @@ -414,14 +392,10 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array * /* This will always be a simple value since 'is_throw' is false, so no need to free. */ ecma_value_t put_comp = ecma_builtin_helper_def_prop_by_index (array_obj_p, (*length_p)++, value, prop_flags); -#if JERRY_ESNEXT if (ECMA_IS_VALUE_ERROR (put_comp)) { return put_comp; } -#else /* !JERRY_ESNEXT */ - JERRY_ASSERT (ecma_is_value_true (put_comp)); -#endif /* JERRY_ESNEXT */ return ECMA_VALUE_EMPTY; } /* ecma_builtin_helper_array_concat_value */ @@ -578,7 +552,6 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st /* 5 (indexOf) -- 6 (lastIndexOf) */ const lit_utf8_size_t original_len = ecma_string_get_length (original_str_p); -#if JERRY_ESNEXT /* 4, 6 (startsWith, includes, endsWith) */ if (mode >= ECMA_STRING_STARTS_WITH) { @@ -595,7 +568,6 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st return ecma_raise_type_error (ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP); } } -#endif /* JERRY_ESNEXT */ /* 7, 8 */ ecma_string_t *search_str_p = ecma_op_to_string (arg1); @@ -609,18 +581,15 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st /* 4 (indexOf, lastIndexOf), 9 (startsWith, includes), 10 (endsWith) */ ecma_number_t pos_num; -#if JERRY_ESNEXT + if (mode > ECMA_STRING_LAST_INDEX_OF) { ret_value = ecma_op_to_integer (arg2, &pos_num); } else { -#endif /* JERRY_ESNEXT */ ret_value = ecma_op_to_number (arg2, &pos_num); -#if JERRY_ESNEXT } -#endif /* JERRY_ESNEXT */ /* 10 (startsWith, includes), 11 (endsWith) */ if (ECMA_IS_VALUE_ERROR (ret_value)) @@ -640,7 +609,6 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st switch (mode) { -#if JERRY_ESNEXT case ECMA_STRING_STARTS_WITH: { if (start > original_len) @@ -685,8 +653,6 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st ret_value = ecma_make_boolean_value (index == (uint32_t) start_ends_with); break; } -#endif /* JERRY_ESNEXT */ - case ECMA_STRING_INDEX_OF: { /* 8 (indexOf) -- 9 (lastIndexOf) */ @@ -932,7 +898,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con } case LIT_CHAR_AMPERSAND: { -#if JERRY_ESNEXT if (JERRY_UNLIKELY (ctx_p->matched_p == NULL)) { JERRY_ASSERT (ctx_p->capture_count == 0); @@ -944,7 +909,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con ecma_stringbuilder_append (&(ctx_p->builder), ecma_get_string_from_value (match_value)); break; } -#endif /* JERRY_ESNEXT */ JERRY_ASSERT (ctx_p->matched_p != NULL); ecma_stringbuilder_append_raw (&(ctx_p->builder), ctx_p->matched_p, ctx_p->matched_size); @@ -957,7 +921,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con } case LIT_CHAR_SINGLE_QUOTE: { -#if JERRY_ESNEXT if (JERRY_UNLIKELY (ctx_p->matched_p == NULL)) { JERRY_ASSERT (ctx_p->capture_count == 0); @@ -975,7 +938,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con (lit_utf8_size_t) (ctx_p->string_p + ctx_p->string_size - begin_p)); break; } -#endif /* JERRY_ESNEXT */ JERRY_ASSERT (ctx_p->matched_p != NULL); ecma_stringbuilder_append_raw (&(ctx_p->builder), @@ -990,12 +952,11 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con if (lit_char_is_decimal_digit (c)) { uint32_t capture_count = ctx_p->capture_count; -#if JERRY_ESNEXT + if (capture_count == 0 && ctx_p->u.collection_p != NULL) { capture_count = ctx_p->u.collection_p->item_count; } -#endif /* JERRY_ESNEXT */ uint8_t idx = (uint8_t) (c - LIT_CHAR_0); if (curr_p < replace_end_p && lit_char_is_decimal_digit (*(curr_p))) @@ -1026,7 +987,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con break; #endif /* JERRY_BUILTIN_REGEXP */ } -#if JERRY_ESNEXT else if (ctx_p->u.collection_p != NULL) { const ecma_value_t capture_value = ctx_p->u.collection_p->buffer_p[idx]; @@ -1037,7 +997,6 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con break; } -#endif /* JERRY_ESNEXT */ } } @@ -1062,6 +1021,19 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con } /* ecma_builtin_replace_substitute */ /** + * Helper function to determine if method is the builtin exec method + * + * @return true, if function is the builtin exec method + * false, otherwise + */ +extern inline bool JERRY_ATTR_ALWAYS_INLINE +ecma_builtin_is_regexp_exec (ecma_extended_object_t *obj_p) /**< function object */ +{ + return (ecma_get_object_type (&obj_p->object) == ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION + && obj_p->u.built_in.routine_id == ECMA_REGEXP_PROTOTYPE_ROUTINE_EXEC); +} /* ecma_builtin_is_regexp_exec */ + +/** * @} * @} */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h index 71ae115b..482cf8fa 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h @@ -29,6 +29,37 @@ */ /** + * List of built-in routine identifiers. + */ +enum +{ + /** These routines must be in this order */ + ECMA_REGEXP_PROTOTYPE_ROUTINE_START = 0, + ECMA_REGEXP_PROTOTYPE_ROUTINE_EXEC, +#if JERRY_BUILTIN_ANNEXB + ECMA_REGEXP_PROTOTYPE_ROUTINE_COMPILE, +#endif /* JERRY_BUILTIN_ANNEXB */ + + ECMA_REGEXP_PROTOTYPE_ROUTINE_TEST, + ECMA_REGEXP_PROTOTYPE_ROUTINE_TO_STRING, + ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_SOURCE, + ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_FLAGS, + + ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_GLOBAL, + ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_IGNORE_CASE, + ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_MULTILINE, + ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_STICKY, + ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_UNICODE, + ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_DOT_ALL, + + ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SEARCH, + ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH, + ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_REPLACE, + ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SPLIT, + ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH_ALL, +}; + +/** * Mode of string index routine. */ typedef enum @@ -90,10 +121,7 @@ typedef struct } ecma_replace_context_t; void ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p); - -#if JERRY_ESNEXT bool ecma_builtin_is_regexp_exec (ecma_extended_object_t *obj_p); -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_DATE diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h index be175c23..3755f612 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h @@ -141,7 +141,6 @@ const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] = { { name, ECMA_BUILTIN_PROPERTY_NUMBER, (prop_attributes) | ECMA_PROPERTY_FLAG_BUILT_IN, number_value }, #define STRING_VALUE(name, magic_string_id, prop_attributes) \ { name, ECMA_BUILTIN_PROPERTY_STRING, (prop_attributes) | ECMA_PROPERTY_FLAG_BUILT_IN, magic_string_id }, -#if JERRY_ESNEXT #define SYMBOL_VALUE(name, symbol) { name, ECMA_BUILTIN_PROPERTY_SYMBOL, ECMA_PROPERTY_BUILT_IN_FIXED, symbol }, #define INTRINSIC_PROPERTY(name, magic_string_id, prop_attributes) \ { name, ECMA_BUILTIN_PROPERTY_INTRINSIC_PROPERTY, (prop_attributes) | ECMA_PROPERTY_FLAG_BUILT_IN, magic_string_id }, @@ -150,7 +149,6 @@ const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] = { ECMA_BUILTIN_PROPERTY_ACCESSOR_BUILTIN_FUNCTION, \ (prop_attributes) | ECMA_PROPERTY_FLAG_BUILT_IN, \ ECMA_ACCESSOR_READ_WRITE (getter_builtin_id, setter_builtin_id) }, -#endif /* JERRY_ESNEXT */ #include BUILTIN_INC_HEADER_NAME { LIT_MAGIC_STRING__COUNT, ECMA_BUILTIN_PROPERTY_END, 0, 0 } }; diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c b/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c index 0134afa6..66519dcd 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c @@ -25,8 +25,6 @@ #include "lit-char-helpers.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -106,7 +104,7 @@ ecma_builtin_intrinsic_array_prototype_values (ecma_value_t this_value) /**< thi * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_intrinsic_map_prototype_entries (ecma_value_t this_value) +ecma_builtin_intrinsic_map_prototype_entries (ecma_value_t this_value) /**< this value */ { ecma_extended_object_t *map_object_p = ecma_op_container_get_object (this_value, LIT_MAGIC_STRING_MAP_UL); @@ -132,7 +130,7 @@ ecma_builtin_intrinsic_map_prototype_entries (ecma_value_t this_value) * Returned value must be freed with ecma_free_value. */ static ecma_value_t -ecma_builtin_intrinsic_set_prototype_values (ecma_value_t this_value) +ecma_builtin_intrinsic_set_prototype_values (ecma_value_t this_value) /**< this value */ { ecma_extended_object_t *map_object_p = ecma_op_container_get_object (this_value, LIT_MAGIC_STRING_SET_UL); @@ -164,10 +162,26 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built- switch (builtin_routine_id) { +#if JERRY_BUILTIN_ARRAY case ECMA_INTRINSIC_ARRAY_PROTOTYPE_VALUES: { return ecma_builtin_intrinsic_array_prototype_values (this_arg); } + case ECMA_INTRINSIC_ARRAY_TO_STRING: + { + ecma_value_t this_obj = ecma_op_to_object (this_arg); + if (ECMA_IS_VALUE_ERROR (this_obj)) + { + return this_obj; + } + + ecma_value_t result = ecma_array_object_to_string (this_obj); + ecma_deref_object (ecma_get_object_from_value (this_obj)); + + return result; + } +#endif /* JERRY_BUILTIN_ARRAY */ +#if JERRY_BUILTIN_TYPEDARRAY case ECMA_INTRINSIC_TYPEDARRAY_PROTOTYPE_VALUES: { if (!ecma_is_typedarray (this_arg)) @@ -182,6 +196,8 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built- return ecma_typedarray_iterators_helper (this_arg, ECMA_ITERATOR_VALUES); } +#endif /* JERRY_BUILTIN_TYPEDARRAY */ +#if JERRY_BUILTIN_CONTAINER case ECMA_INTRINSIC_SET_PROTOTYPE_VALUES: { return ecma_builtin_intrinsic_set_prototype_values (this_arg); @@ -190,19 +206,8 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built- { return ecma_builtin_intrinsic_map_prototype_entries (this_arg); } - case ECMA_INTRINSIC_ARRAY_TO_STRING: - { - ecma_value_t this_obj = ecma_op_to_object (this_arg); - if (ECMA_IS_VALUE_ERROR (this_obj)) - { - return this_obj; - } - - ecma_value_t result = ecma_array_object_to_string (this_obj); - ecma_deref_object (ecma_get_object_from_value (this_obj)); - - return result; - } +#endif /* JERRY_BUILTIN_CONTAINER */ +#if JERRY_BUILTIN_DATE case ECMA_INTRINSIC_DATE_TO_UTC_STRING: { if (!ecma_is_value_object (this_arg) @@ -211,13 +216,7 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built- return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_DATE_OBJECT); } -#if JERRY_ESNEXT ecma_number_t *date_value_p = &((ecma_date_object_t *) ecma_get_object_from_value (this_arg))->date_value; -#else /* !JERRY_ESNEXT */ - ecma_extended_object_t *arg_ext_object_p = (ecma_extended_object_t *) ecma_get_object_from_value (argument); - ecma_number_t *date_value_p = - ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, arg_ext_object_p->u.class_prop.u.date); -#endif /* JERRY_ESNEXT */ if (ecma_number_is_nan (*date_value_p)) { @@ -226,6 +225,8 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built- return ecma_date_value_to_utc_string (*date_value_p); } +#endif /* JERRY_BUILTIN_DATE */ +#if JERRY_BUILTIN_STRING case ECMA_INTRINSIC_STRING_TRIM_START: case ECMA_INTRINSIC_STRING_TRIM_END: { @@ -265,6 +266,7 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built- ecma_deref_ecma_string (to_str_p); return result; } +#endif /* JERRY_BUILTIN_STRING */ default: { JERRY_ASSERT (builtin_routine_id == ECMA_INTRINSIC_PARSE_INT || builtin_routine_id == ECMA_INTRINSIC_PARSE_FLOAT); @@ -301,5 +303,3 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built- * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h index d3d0e582..54c82c4d 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_INTERNAL_MAGIC_STRING_ARRAY_PROTOTYPE_VALUES, ECMA_INTRINSIC_ARRAY_PROTOTYPE_VALUES, 0, 0) @@ -33,5 +31,5 @@ ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_INTRINSIC_ARRAY_TO_STRING, 0, 0) ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_INTRINSIC_DATE_TO_UTC_STRING, 0, 0) ROUTINE (LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_INTRINSIC_PARSE_FLOAT, 1, 1) ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ECMA_INTRINSIC_PARSE_INT, 2, 2) -#endif /* JERRY_ESNEXT */ + #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c index 1bcc9166..ca991d66 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c @@ -17,8 +17,6 @@ #include "ecma-builtins.h" #include "ecma-iterator-object.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -102,5 +100,3 @@ ecma_builtin_iterator_prototype_dispatch_routine (uint8_t builtin_routine_id, /* * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h index 4719360a..4054eb40 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.inc.h @@ -19,12 +19,8 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_BUILTIN_ITERATOR_PROTOTYPE_OBJECT_ITERATOR, 0, 0) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-json.c b/jerry-core/ecma/builtin-objects/ecma-builtin-json.c index 2dfa053a..11a6871b 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-json.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-json.c @@ -653,13 +653,11 @@ ecma_builtin_json_internalize_property (ecma_object_t *reviver_p, /**< reviver f /* 3.a */ ecma_value_t is_array = ecma_is_value_array (value); -#if JERRY_ESNEXT if (ECMA_IS_VALUE_ERROR (is_array)) { ecma_free_value (value); return is_array; } -#endif /* JERRY_ESNEXT */ ecma_object_t *object_p = ecma_get_object_from_value (value); @@ -702,15 +700,12 @@ ecma_builtin_json_internalize_property (ecma_object_t *reviver_p, /**< reviver f { ecma_collection_t *props_p = ecma_op_object_get_enumerable_property_names (object_p, ECMA_ENUMERABLE_PROPERTY_KEYS); -#if JERRY_ESNEXT + if (JERRY_UNLIKELY (props_p == NULL)) { ecma_deref_object (object_p); return ECMA_VALUE_ERROR; } -#else /* !JERRY_ESNEXT */ - JERRY_ASSERT (props_p != NULL); -#endif /* JERRY_ESNEXT */ ecma_value_t *buffer_p = props_p->buffer_p; @@ -773,12 +768,10 @@ ecma_builtin_json_internalize_process_property (ecma_object_t *reviver_p, /**< r /* ES11: 2.b.iii.2.a / 2.c.ii.2.a */ ecma_value_t delete_val = ecma_op_object_delete (object_p, prop_name, false); -#if JERRY_ESNEXT if (ECMA_IS_VALUE_ERROR (delete_val)) { return delete_val; } -#endif /* JERRY_ESNEXT */ JERRY_ASSERT (ecma_is_value_boolean (delete_val)); } @@ -789,12 +782,10 @@ ecma_builtin_json_internalize_process_property (ecma_object_t *reviver_p, /**< r ecma_builtin_helper_def_prop (object_p, prop_name, new_element, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE); ecma_free_value (new_element); -#if JERRY_ESNEXT if (ECMA_IS_VALUE_ERROR (def_value)) { return def_value; } -#endif /* JERRY_ESNEXT */ JERRY_ASSERT (ecma_is_value_boolean (def_value)); } @@ -900,7 +891,6 @@ ecma_builtin_json_quote (ecma_stringbuilder_t *builder_p, /**< builder for the r bool should_escape = false; -#if JERRY_ESNEXT if (lit_is_code_point_utf16_high_surrogate (c)) { if (str_p < str_end_p) @@ -922,7 +912,6 @@ ecma_builtin_json_quote (ecma_stringbuilder_t *builder_p, /**< builder for the r { should_escape = true; } -#endif /* JERRY_ESNEXT */ if (c == LIT_CHAR_BACKSLASH || c == LIT_CHAR_DOUBLE_QUOTE) { @@ -1571,12 +1560,10 @@ ecma_builtin_json_stringify (ecma_value_t arg1, /**< value */ { ecma_value_t is_array = ecma_is_value_array (arg2); -#if JERRY_ESNEXT if (ECMA_IS_VALUE_ERROR (is_array)) { return is_array; } -#endif /* JERRY_ESNEXT */ if (ecma_is_value_true (is_array)) { diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h index 21776999..30d13551 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h @@ -21,10 +21,8 @@ #if JERRY_BUILTIN_JSON -#if JERRY_ESNEXT /* ECMA-262 v6, 24.3.3 */ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_JSON_U, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-math.c b/jerry-core/ecma/builtin-objects/ecma-builtin-math.c index 0e69365f..33a9bc23 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-math.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-math.c @@ -62,7 +62,6 @@ enum ECMA_MATH_OBJECT_SIN, /* ECMA-262 v5, 15.8.2.16 */ ECMA_MATH_OBJECT_SQRT, /* ECMA-262 v5, 15.8.2.17 */ ECMA_MATH_OBJECT_TAN, /* ECMA-262 v5, 15.8.2.18 */ -#if JERRY_ESNEXT ECMA_MATH_OBJECT_ACOSH, /* ECMA-262 v6, 20.2.2.3 */ ECMA_MATH_OBJECT_ASINH, /* ECMA-262 v6, 20.2.2.5 */ ECMA_MATH_OBJECT_ATANH, /* ECMA-262 v6, 20.2.2.7 */ @@ -78,19 +77,14 @@ enum ECMA_MATH_OBJECT_SINH, /* ECMA-262 v6, 20.2.2.31 */ ECMA_MATH_OBJECT_TANH, /* ECMA-262 v6, 20.2.2.34 */ ECMA_MATH_OBJECT_TRUNC, /* ECMA-262 v6, 20.2.2.35 */ -#endif /* JERRY_ESNEXT */ ECMA_MATH_OBJECT_ATAN2, -/* ECMA-262 v5, 15.8.2.5 */ /* first routine with 2 arguments */ -#if JERRY_ESNEXT + /* ECMA-262 v5, 15.8.2.5 */ /* first routine with 2 arguments */ ECMA_MATH_OBJECT_IMUL, /* ECMA-262 v6, 20.2.2.19 */ -#endif /* JERRY_ESNEXT */ ECMA_MATH_OBJECT_POW, /* ECMA-262 v5, 15.8.2.13 */ /* last routine with 1 or 2 arguments*/ ECMA_MATH_OBJECT_MAX, /* ECMA-262 v5, 15.8.2.11 */ ECMA_MATH_OBJECT_MIN, /* ECMA-262 v5, 15.8.2.12 */ -#if JERRY_ESNEXT ECMA_MATH_OBJECT_HYPOT, /* ECMA-262 v6, 20.2.2.18 */ -#endif /* JERRY_ESNEXT */ ECMA_MATH_OBJECT_RANDOM, /* ECMA-262 v5, 15.8.2.14 */ }; @@ -164,7 +158,6 @@ ecma_builtin_math_object_max_min (bool is_max, /**< 'max' or 'min' operation */ return ecma_make_number_value (result_num); } /* ecma_builtin_math_object_max_min */ -#if JERRY_ESNEXT /** * The Math object's 'hypot' routine * @@ -270,8 +263,6 @@ ecma_builtin_math_object_sign (ecma_number_t arg) return (ecma_number_t) 1.0; } /* ecma_builtin_math_object_sign */ -#endif /* JERRY_ESNEXT */ - /** * The Math object's 'random' routine. * @@ -384,7 +375,6 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi x = DOUBLE_TO_ECMA_NUMBER_T (log (x)); break; } -#if JERRY_ESNEXT case ECMA_MATH_OBJECT_TRUNC: { x = ecma_builtin_math_object_trunc (x); @@ -395,7 +385,6 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi x = ecma_builtin_math_object_sign (x); break; } -#endif /* JERRY_ESNEXT */ case ECMA_MATH_OBJECT_ROUND: { if (ecma_number_is_nan (x) || ecma_number_is_zero (x) || ecma_number_is_infinity (x)) @@ -456,7 +445,6 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi x = ecma_number_pow (x, y); break; } -#if JERRY_ESNEXT case ECMA_MATH_OBJECT_ACOSH: { x = DOUBLE_TO_ECMA_NUMBER_T (acosh (x)); @@ -543,7 +531,6 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi x = (int32_t) (ecma_number_to_uint32 (x) * ecma_number_to_uint32 (y)); break; } -#endif /* JERRY_ESNEXT */ } return ecma_make_number_value (x); } /* if (builtin_routine_id <= ECMA_MATH_OBJECT_POW) */ @@ -555,12 +542,10 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi arguments_number); } -#if JERRY_ESNEXT if (builtin_routine_id == ECMA_MATH_OBJECT_HYPOT) { return ecma_builtin_math_object_hypot (arguments_list, arguments_number); } -#endif /* JERRY_ESNEXT */ JERRY_ASSERT (builtin_routine_id == ECMA_MATH_OBJECT_RANDOM); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h index 16d24d5e..c30ad25d 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h @@ -48,10 +48,8 @@ NUMBER_VALUE (LIT_MAGIC_STRING_SQRT1_2_U, ECMA_BUILTIN_NUMBER_SQRT_1_2, ECMA_PRO /* ECMA-262 v5, 15.8.1.8 */ NUMBER_VALUE (LIT_MAGIC_STRING_SQRT2_U, ECMA_BUILTIN_NUMBER_SQRT2, ECMA_PROPERTY_FIXED) -#if JERRY_ESNEXT /* ECMA-262 v6, 20.2.1.9 */ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_MATH_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ @@ -73,7 +71,6 @@ ROUTINE (LIT_MAGIC_STRING_ROUND, ECMA_MATH_OBJECT_ROUND, 1, 1) ROUTINE (LIT_MAGIC_STRING_SIN, ECMA_MATH_OBJECT_SIN, 1, 1) ROUTINE (LIT_MAGIC_STRING_SQRT, ECMA_MATH_OBJECT_SQRT, 1, 1) ROUTINE (LIT_MAGIC_STRING_TAN, ECMA_MATH_OBJECT_TAN, 1, 1) -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_ACOSH, ECMA_MATH_OBJECT_ACOSH, 1, 1) ROUTINE (LIT_MAGIC_STRING_ASINH, ECMA_MATH_OBJECT_ASINH, 1, 1) ROUTINE (LIT_MAGIC_STRING_ATANH, ECMA_MATH_OBJECT_ATANH, 1, 1) @@ -91,7 +88,6 @@ ROUTINE (LIT_MAGIC_STRING_SIGN, ECMA_MATH_OBJECT_SIGN, 1, 1) ROUTINE (LIT_MAGIC_STRING_SINH, ECMA_MATH_OBJECT_SINH, 1, 1) ROUTINE (LIT_MAGIC_STRING_TANH, ECMA_MATH_OBJECT_TANH, 1, 1) ROUTINE (LIT_MAGIC_STRING_TRUNC, ECMA_MATH_OBJECT_TRUNC, 1, 1) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_MATH */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-number.c b/jerry-core/ecma/builtin-objects/ecma-builtin-number.c index 6d4dfbd7..89fa1ab9 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-number.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-number.c @@ -34,7 +34,6 @@ #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" -#if JERRY_ESNEXT /** * This object has a custom dispatch function. */ @@ -51,7 +50,6 @@ enum ECMA_NUMBER_OBJECT_ROUTINE_IS_INTEGER, ECMA_NUMBER_OBJECT_ROUTINE_IS_SAFE_INTEGER }; -#endif /* JERRY_ESNEXT */ #define BUILTIN_INC_HEADER_NAME "ecma-builtin-number.inc.h" #define BUILTIN_UNDERSCORED_ID number @@ -155,7 +153,6 @@ ecma_builtin_number_dispatch_construct (const ecma_value_t *arguments_list_p, /* #endif /* JERRY_BUILTIN_BIGINT */ } /* ecma_builtin_number_dispatch_construct */ -#if JERRY_ESNEXT /** * The Number object 'isInteger' and 'isSafeInteger' routine * @@ -240,8 +237,6 @@ ecma_builtin_number_dispatch_routine (uint8_t builtin_routine_id, /**< built-in } } /* ecma_builtin_number_dispatch_routine */ -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h index c586aa07..5a30cbf0 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h @@ -41,8 +41,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_POSITIVE_INFINITY_U, ECMA_BUILTIN_NUMBER_POSITIVE /* ECMA-262 v5, 15.7.3.6 */ NUMBER_VALUE (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U, ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY, ECMA_PROPERTY_FIXED) -#if JERRY_ESNEXT - /* ECMA-262 v6, 20.1.2.1 */ NUMBER_VALUE (LIT_MAGIC_STRING_EPSILON_U, ECMA_BUILTIN_NUMBER_EPSILON, ECMA_PROPERTY_FIXED) @@ -53,7 +51,6 @@ NUMBER_VALUE (LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U, ECMA_BUILTIN_NUMBER_MAX_SAFE_ NUMBER_VALUE (LIT_MAGIC_STRING_MIN_SAFE_INTEGER_U, ECMA_BUILTIN_NUMBER_MIN_SAFE_INTEGER, ECMA_PROPERTY_FIXED) STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_NUMBER_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ /* Object properties: * (property name, object pointer getter) */ @@ -65,12 +62,11 @@ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_NUMBER_PROTOTYPE, ECMA /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_IS_FINITE, ECMA_NUMBER_OBJECT_ROUTINE_IS_FINITE, 1, 1) ROUTINE (LIT_MAGIC_STRING_IS_NAN, ECMA_NUMBER_OBJECT_ROUTINE_IS_NAN, 1, 1) ROUTINE (LIT_MAGIC_STRING_IS_INTEGER, ECMA_NUMBER_OBJECT_ROUTINE_IS_INTEGER, 1, 1) ROUTINE (LIT_MAGIC_STRING_IS_SAFE_INTEGER, ECMA_NUMBER_OBJECT_ROUTINE_IS_SAFE_INTEGER, 1, 1) INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_FLOAT, LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_INT, LIT_MAGIC_STRING_PARSE_INT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* JERRY_ESNEXT */ + #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c index e57af2ec..28abfbb4 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c @@ -52,12 +52,12 @@ enum ECMA_OBJECT_PROTOTYPE_HAS_OWN_PROPERTY, ECMA_OBJECT_PROTOTYPE_PROPERTY_IS_ENUMERABLE, ECMA_OBJECT_PROTOTYPE_SET_PROTO, -#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB +#if JERRY_BUILTIN_ANNEXB ECMA_OBJECT_PROTOTYPE_DEFINE_GETTER, ECMA_OBJECT_PROTOTYPE_DEFINE_SETTER, ECMA_OBJECT_PROTOTYPE_LOOKUP_GETTER, ECMA_OBJECT_PROTOTYPE_LOOKUP_SETTER, -#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */ +#endif /* JERRY_BUILTIN_ANNEXB */ }; #define BUILTIN_INC_HEADER_NAME "ecma-builtin-object-prototype.inc.h" @@ -193,7 +193,7 @@ ecma_builtin_object_prototype_object_property_is_enumerable (ecma_object_t *obj_ return ecma_make_boolean_value (is_enumerable); } /* ecma_builtin_object_prototype_object_property_is_enumerable */ -#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB +#if JERRY_BUILTIN_ANNEXB /** * The Object.prototype object's '__defineGetter__' and '__defineSetter__' routine * @@ -369,7 +369,7 @@ ecma_builtin_object_prototype_lookup_getter_setter (ecma_value_t this_arg, /**< return ret_value; } /* ecma_builtin_object_prototype_lookup_getter_setter */ -#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */ +#endif /* JERRY_BUILTIN_ANNEXB */ /** * Dispatcher of the built-in's routines @@ -427,13 +427,11 @@ ecma_builtin_object_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< ecma_value_t ret_value; -#if JERRY_ESNEXT if (builtin_routine_id == ECMA_OBJECT_PROTOTYPE_GET_PROTO) { ret_value = ecma_builtin_object_object_get_prototype_of (obj_p); } else -#endif /* JERRY_ESNEXT */ { ret_value = ecma_builtin_object_prototype_object_is_prototype_of (obj_p, arguments_list_p[0]); } @@ -445,7 +443,6 @@ ecma_builtin_object_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< JERRY_ASSERT (builtin_routine_id >= ECMA_OBJECT_PROTOTYPE_HAS_OWN_PROPERTY); -#if JERRY_ESNEXT if (builtin_routine_id == ECMA_OBJECT_PROTOTYPE_SET_PROTO) { return ecma_builtin_object_object_set_proto (this_arg, arguments_list_p[0]); @@ -474,7 +471,6 @@ ecma_builtin_object_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< false); } #endif /* JERRY_BUILTIN_ANNEXB */ -#endif /* JERRY_ESNEXT*/ ecma_string_t *prop_name_p = ecma_op_to_property_key (arguments_list_p[0]); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h index 47d2b8b4..b218eda5 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h @@ -39,11 +39,11 @@ ROUTINE (LIT_MAGIC_STRING_HAS_OWN_PROPERTY_UL, ECMA_OBJECT_PROTOTYPE_HAS_OWN_PRO ROUTINE (LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL, ECMA_OBJECT_PROTOTYPE_IS_PROTOTYPE_OF, 1, 1) ROUTINE (LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL, ECMA_OBJECT_PROTOTYPE_PROPERTY_IS_ENUMERABLE, 1, 1) -#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB +#if JERRY_BUILTIN_ANNEXB ROUTINE (LIT_MAGIC_STRING_DEFINE_GETTER, ECMA_OBJECT_PROTOTYPE_DEFINE_GETTER, 2, 2) ROUTINE (LIT_MAGIC_STRING_DEFINE_SETTER, ECMA_OBJECT_PROTOTYPE_DEFINE_SETTER, 2, 2) ROUTINE (LIT_MAGIC_STRING_LOOKUP_GETTER, ECMA_OBJECT_PROTOTYPE_LOOKUP_GETTER, 1, 1) ROUTINE (LIT_MAGIC_STRING_LOOKUP_SETTER, ECMA_OBJECT_PROTOTYPE_LOOKUP_SETTER, 1, 1) -#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB*/ +#endif /* JERRY_BUILTIN_ANNEXB*/ #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object.c b/jerry-core/ecma/builtin-objects/ecma-builtin-object.c index e355e687..392ba2d3 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-object.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object.c @@ -21,20 +21,17 @@ #include "ecma-builtins.h" #include "ecma-conversion.h" #include "ecma-exceptions.h" +#include "ecma-function-object.h" #include "ecma-gc.h" #include "ecma-globals.h" #include "ecma-helpers.h" +#include "ecma-iterator-object.h" #include "ecma-objects-general.h" #include "ecma-objects.h" #include "ecma-proxy-object.h" -#include "jrt.h" -#if JERRY_ESNEXT -#include "ecma-function-object.h" -#include "ecma-iterator-object.h" - #include "jcontext.h" -#endif /* JERRY_ESNEXT */ +#include "jrt.h" #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -126,7 +123,6 @@ ecma_value_t ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ uint32_t arguments_list_len) /**< number of arguments */ { -#if JERRY_ESNEXT if (JERRY_CONTEXT (current_new_target_p) != ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT)) { ecma_object_t *prototype_obj_p = @@ -141,7 +137,7 @@ ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /* return ecma_make_object_value (object_p); } -#endif /* JERRY_ESNEXT */ + return ecma_builtin_object_dispatch_call (arguments_list_p, arguments_list_len); } /* ecma_builtin_object_dispatch_construct */ @@ -176,7 +172,6 @@ ecma_builtin_object_object_get_prototype_of (ecma_object_t *obj_p) /**< routine' return ECMA_VALUE_NULL; } /* ecma_builtin_object_object_get_prototype_of */ -#if JERRY_ESNEXT /** * The Object object's 'setPrototypeOf' routine * @@ -303,7 +298,6 @@ ecma_builtin_object_object_set_proto (ecma_value_t arg1, /**< routine's first ar return ECMA_VALUE_UNDEFINED; } /* ecma_builtin_object_object_set_proto */ -#endif /* JERRY_ESNEXT */ /** * SetIntegrityLevel operation @@ -731,7 +725,6 @@ ecma_builtin_object_object_get_own_property_descriptor (ecma_object_t *obj_p, /* return ECMA_VALUE_UNDEFINED; } /* ecma_builtin_object_object_get_own_property_descriptor */ -#if JERRY_ESNEXT /** * The Object object's 'getOwnPropertyDescriptors' routine * @@ -799,7 +792,6 @@ ecma_builtin_object_object_get_own_property_descriptors (ecma_object_t *obj_p) / return ecma_make_object_value (descriptors_p); } /* ecma_builtin_object_object_get_own_property_descriptors */ -#endif /* JERRY_ESNEXT */ /** * The Object object's 'defineProperties' routine @@ -852,12 +844,10 @@ ecma_builtin_object_object_define_properties (ecma_object_t *obj_p, /**< routine ecma_property_descriptor_t prop_desc; ecma_value_t get_desc = ecma_op_object_get_own_property_descriptor (props_p, prop_name_p, &prop_desc); -#if JERRY_ESNEXT if (ECMA_IS_VALUE_ERROR (get_desc)) { goto cleanup; } -#endif /* JERRY_ESNEXT */ if (ecma_is_value_true (get_desc)) { @@ -1024,8 +1014,6 @@ ecma_builtin_object_object_define_property (ecma_object_t *obj_p, /**< routine's return ecma_make_object_value (obj_p); } /* ecma_builtin_object_object_define_property */ -#if JERRY_ESNEXT - /** * The Object object's 'assign' routine * @@ -1286,8 +1274,6 @@ cleanup_iterator: return result; } /* ecma_builtin_object_from_entries */ -#endif /* JERRY_ESNEXT */ - /** * GetOwnPropertyKeys abstract method * @@ -1301,7 +1287,6 @@ static ecma_value_t ecma_op_object_get_own_property_keys (ecma_value_t this_arg, /**< this argument */ uint16_t type) /**< routine type */ { -#if JERRY_ESNEXT /* 1. */ ecma_value_t object = ecma_op_to_object (this_arg); @@ -1351,12 +1336,6 @@ ecma_op_object_get_own_property_keys (ecma_value_t this_arg, /**< this argument ecma_collection_free (props_p); return result_array; -#else /* !JERRY_ESNEXT */ - JERRY_UNUSED (type); - ecma_object_t *obj_p = ecma_get_object_from_value (this_arg); - ecma_collection_t *props_p = ecma_op_object_own_property_keys (obj_p, JERRY_PROPERTY_FILTER_ALL); - return ecma_op_new_array_object_from_collection (props_p, false); -#endif /* JERRY_ESNEXT */ } /* ecma_op_object_get_own_property_keys */ /** @@ -1384,7 +1363,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in { return ecma_builtin_object_object_create (arg1, arg2); } -#if JERRY_ESNEXT case ECMA_OBJECT_ROUTINE_SET_PROTOTYPE_OF: { return ecma_builtin_object_object_set_prototype_of (arg1, arg2); @@ -1393,7 +1371,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in { return ecma_builtin_object_object_is (arg1, arg2); } -#endif /* JERRY_ESNEXT */ default: { break; @@ -1401,21 +1378,13 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in } ecma_object_t *obj_p; -#if !JERRY_ESNEXT - if (!ecma_is_value_object (arg1)) - { - return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT); - } -#endif /* !JERRY_ESNEXT */ if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_DEFINE_PROPERTIES) { -#if JERRY_ESNEXT if (!ecma_is_value_object (arg1)) { return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT); } -#endif /* JERRY_ESNEXT */ obj_p = ecma_get_object_from_value (arg1); @@ -1439,7 +1408,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in } else if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_ENTRIES) { -#if JERRY_ESNEXT ecma_value_t object = ecma_op_to_object (arg1); if (ECMA_IS_VALUE_ERROR (object)) { @@ -1447,9 +1415,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in } obj_p = ecma_get_object_from_value (object); -#else /* !JERRY_ESNEXT */ - obj_p = ecma_get_object_from_value (arg1); -#endif /* JERRY_ESNEXT */ ecma_value_t result; switch (builtin_routine_id) @@ -1459,7 +1424,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in result = ecma_builtin_object_object_get_prototype_of (obj_p); break; } -#if JERRY_ESNEXT case ECMA_OBJECT_ROUTINE_ASSIGN: { result = ecma_builtin_object_object_assign (obj_p, arguments_list_p + 1, arguments_number - 1); @@ -1467,7 +1431,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in } case ECMA_OBJECT_ROUTINE_ENTRIES: case ECMA_OBJECT_ROUTINE_VALUES: -#endif /* JERRY_ESNEXT */ case ECMA_OBJECT_ROUTINE_KEYS: { JERRY_ASSERT (builtin_routine_id - ECMA_OBJECT_ROUTINE_KEYS < ECMA_ENUMERABLE_PROPERTY__COUNT); @@ -1491,7 +1454,6 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in ecma_deref_ecma_string (prop_name_p); break; } -#if JERRY_ESNEXT case ECMA_OBJECT_ROUTINE_HAS_OWN: { ecma_string_t *prop_name_p = ecma_op_to_property_key (arg2); @@ -1516,16 +1478,13 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in result = ecma_builtin_object_from_entries (arg1); break; } -#endif /* JERRY_ESNEXT */ default: { JERRY_UNREACHABLE (); } } -#if JERRY_ESNEXT ecma_deref_object (obj_p); -#endif /* JERRY_ESNEXT */ return result; } else if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_SYMBOLS) @@ -1534,12 +1493,10 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in } else if (builtin_routine_id <= ECMA_OBJECT_ROUTINE_SEAL) { -#if JERRY_ESNEXT if (!ecma_is_value_object (arg1)) { return ecma_copy_value (arg1); } -#endif /* JERRY_ESNEXT */ obj_p = ecma_get_object_from_value (arg1); switch (builtin_routine_id) @@ -1565,12 +1522,11 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in else { JERRY_ASSERT (builtin_routine_id <= ECMA_OBJECT_ROUTINE_IS_SEALED); -#if JERRY_ESNEXT + if (!ecma_is_value_object (arg1)) { return ecma_make_boolean_value (builtin_routine_id != ECMA_OBJECT_ROUTINE_IS_EXTENSIBLE); } -#endif /* JERRY_ESNEXT */ obj_p = ecma_get_object_from_value (arg1); switch (builtin_routine_id) 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 b046141b..ee02ad62 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h @@ -29,43 +29,31 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.2.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, ECMA_PROPERTY_FIXED) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_OBJECT_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_GET_PROTOTYPE_OF_UL, ECMA_OBJECT_ROUTINE_GET_PROTOTYPE_OF, 1, 1) ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_NAMES, 1, 1) -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_SYMBOLS, 1, 1) -#endif /* JERRY_ESNEXT */ ROUTINE (LIT_MAGIC_STRING_SEAL, ECMA_OBJECT_ROUTINE_SEAL, 1, 1) ROUTINE (LIT_MAGIC_STRING_FREEZE, ECMA_OBJECT_ROUTINE_FREEZE, 1, 1) ROUTINE (LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL, ECMA_OBJECT_ROUTINE_PREVENT_EXTENSIONS, 1, 1) ROUTINE (LIT_MAGIC_STRING_IS_SEALED_UL, ECMA_OBJECT_ROUTINE_IS_SEALED, 1, 1) ROUTINE (LIT_MAGIC_STRING_IS_FROZEN_UL, ECMA_OBJECT_ROUTINE_IS_FROZEN, 1, 1) ROUTINE (LIT_MAGIC_STRING_IS_EXTENSIBLE, ECMA_OBJECT_ROUTINE_IS_EXTENSIBLE, 1, 1) -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_ENTRIES, ECMA_OBJECT_ROUTINE_ENTRIES, 1, 1) ROUTINE (LIT_MAGIC_STRING_VALUES, ECMA_OBJECT_ROUTINE_VALUES, 1, 1) -#endif /* JERRY_ESNEXT */ ROUTINE (LIT_MAGIC_STRING_KEYS, ECMA_OBJECT_ROUTINE_KEYS, 1, 1) ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_DESCRIPTOR, 2, 2) -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_HAS_OWN_UL, ECMA_OBJECT_ROUTINE_HAS_OWN, 2, 2) ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTORS_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_DESCRIPTORS, 1, 1) ROUTINE (LIT_MAGIC_STRING_OBJECT_FROM_ENTRIES, ECMA_OBJECT_ROUTINE_FROM_ENTRIES, 1, 1) -#endif /* JERRY_ESNEXT */ ROUTINE (LIT_MAGIC_STRING_CREATE, ECMA_OBJECT_ROUTINE_CREATE, 2, 2) ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL, ECMA_OBJECT_ROUTINE_DEFINE_PROPERTIES, 2, 2) ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTY_UL, ECMA_OBJECT_ROUTINE_DEFINE_PROPERTY, 3, 3) - -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, ECMA_OBJECT_ROUTINE_SET_PROTOTYPE_OF, 2, 2) ROUTINE (LIT_MAGIC_STRING_ASSIGN, ECMA_OBJECT_ROUTINE_ASSIGN, NON_FIXED, 2) ROUTINE (LIT_MAGIC_STRING_IS, ECMA_OBJECT_ROUTINE_IS, 2, 2) -#endif /* JERRY_ESNEXT */ #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c index 252512d6..b24f6d5b 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c @@ -16,8 +16,6 @@ #include "ecma-globals.h" #include "ecma-promise-object.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -93,5 +91,3 @@ ecma_builtin_promise_prototype_dispatch_routine (uint8_t builtin_routine_id, /** * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h index 2f741624..76ee6fda 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h @@ -15,8 +15,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Object properties: * (property name, object pointer getter) */ @@ -29,6 +27,4 @@ ROUTINE (LIT_MAGIC_STRING_THEN, ECMA_PROMISE_PROTOTYPE_ROUTINE_THEN, 2, 2) ROUTINE (LIT_MAGIC_STRING_CATCH, ECMA_PROMISE_PROTOTYPE_ROUTINE_CATCH, 1, 1) ROUTINE (LIT_MAGIC_STRING_FINALLY, ECMA_PROMISE_PROTOTYPE_ROUTINE_FINALLY, 1, 1) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c index 7a53b9c1..02f600c5 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c @@ -27,8 +27,6 @@ #include "jcontext.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -527,5 +525,3 @@ ecma_builtin_promise_dispatch_routine (uint8_t builtin_routine_id, /**< built-in * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h index 52a63aa4..6c697539 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Number properties: * (property name, number value, writable, enumerable, configurable) */ @@ -45,6 +43,4 @@ ROUTINE (LIT_MAGIC_STRING_ANY, ECMA_PROMISE_ROUTINE_ANY, 1, 1) /* ES2015 25.4.4.6 */ ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES, ECMA_PROMISE_ROUTINE_SPECIES_GET, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c index 83ae4feb..c17a2369 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c @@ -67,9 +67,6 @@ ecma_value_t ecma_builtin_range_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ uint32_t arguments_list_len) /**< number of arguments */ { -#if !JERRY_ESNEXT - return ecma_builtin_range_error_dispatch_call (arguments_list_p, arguments_list_len); -#else /* JERRY_ESNEXT */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE); @@ -89,7 +86,6 @@ ecma_builtin_range_error_dispatch_construct (const ecma_value_t *arguments_list_ ecma_deref_object (proto_p); return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_range_error_dispatch_construct */ /** diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h index 042c13a3..6891fa5b 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h @@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.11.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_RANGE_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_ERRORS */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c index 5c983555..2a3f2da5 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c @@ -67,9 +67,6 @@ ecma_value_t ecma_builtin_reference_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ uint32_t arguments_list_len) /**< number of arguments */ { -#if !JERRY_ESNEXT - return ecma_builtin_reference_error_dispatch_call (arguments_list_p, arguments_list_len); -#else /* JERRY_ESNEXT */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE); @@ -89,7 +86,6 @@ ecma_builtin_reference_error_dispatch_construct (const ecma_value_t *arguments_l ecma_deref_object (proto_p); return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_reference_error_dispatch_construct */ /** diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h index fa268dbc..b28ada19 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h @@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.11.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_REFERENCE_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_ERRORS */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c index 69fa1e47..94c0384d 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c @@ -41,39 +41,6 @@ */ #define BUILTIN_CUSTOM_DISPATCH -/** - * List of built-in routine identifiers. - */ -enum -{ - /** These routines must be in this order */ - ECMA_REGEXP_PROTOTYPE_ROUTINE_START = 0, - ECMA_REGEXP_PROTOTYPE_ROUTINE_EXEC, -#if JERRY_BUILTIN_ANNEXB - ECMA_REGEXP_PROTOTYPE_ROUTINE_COMPILE, -#endif /* JERRY_BUILTIN_ANNEXB */ - - ECMA_REGEXP_PROTOTYPE_ROUTINE_TEST, - ECMA_REGEXP_PROTOTYPE_ROUTINE_TO_STRING, -#if JERRY_ESNEXT - ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_SOURCE, - ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_FLAGS, - - ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_GLOBAL, - ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_IGNORE_CASE, - ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_MULTILINE, - ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_STICKY, - ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_UNICODE, - ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_DOT_ALL, - - ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SEARCH, - ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH, - ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_REPLACE, - ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SPLIT, - ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH_ALL, -#endif /* JERRY_ESNEXT */ -}; - #define BUILTIN_INC_HEADER_NAME "ecma-builtin-regexp-prototype.inc.h" #define BUILTIN_UNDERSCORED_ID regexp_prototype #include "ecma-builtin-internal-routines-template.inc.h" @@ -88,7 +55,6 @@ enum * @{ */ -#if JERRY_ESNEXT /** * Helper function to retrieve the flags associated with a RegExp object * @@ -239,7 +205,6 @@ ecma_builtin_regexp_prototype_get_source (ecma_extended_object_t *re_obj_p) /**< return ecma_op_escape_regexp_pattern (ecma_get_string_from_value (bc_p->source)); } /* ecma_builtin_regexp_prototype_get_source */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_ANNEXB /** @@ -258,13 +223,6 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this */ ecma_value_t pattern_arg, /**< pattern or RegExp object */ ecma_value_t flags_arg) /**< flags */ { -#if !JERRY_ESNEXT - if (ecma_get_object_from_value (this_arg) == ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE)) - { - return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP); - } -#endif /* !JERRY_ESNEXT */ - ecma_object_t *this_obj_p = ecma_get_object_from_value (this_arg); ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) this_obj_p; re_compiled_code_t *old_bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t, re_obj_p->u.cls.u3.value); @@ -362,7 +320,6 @@ static ecma_value_t ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */ ecma_value_t arg) /**< routine's argument */ { -#if JERRY_ESNEXT ecma_string_t *arg_str_p = ecma_op_to_string (arg); if (JERRY_UNLIKELY (arg_str_p == NULL)) @@ -378,14 +335,6 @@ ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */ { return result; } -#else /* !JERRY_ESNEXT */ - ecma_value_t result = ecma_builtin_regexp_prototype_exec (this_arg, arg); - - if (ECMA_IS_VALUE_ERROR (result)) - { - return result; - } -#endif /* JERRY_ESNEXT */ ecma_value_t ret_value = ecma_make_boolean_value (!ecma_is_value_null (result)); ecma_free_value (result); @@ -405,7 +354,6 @@ ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */ static ecma_value_t ecma_builtin_regexp_prototype_to_string (ecma_object_t *object_p) /**< this object */ { -#if JERRY_ESNEXT ecma_value_t result = ecma_op_object_get_by_magic_id (object_p, LIT_MAGIC_STRING_SOURCE); if (ECMA_IS_VALUE_ERROR (result)) { @@ -446,54 +394,8 @@ ecma_builtin_regexp_prototype_to_string (ecma_object_t *object_p) /**< this obje ecma_deref_ecma_string (flags_p); return ecma_make_string_value (ecma_stringbuilder_finalize (&builder)); -#else /* !JERRY_ESNEXT */ - ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) object_p; - - re_compiled_code_t *bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t, re_obj_p->u.cls.u3.value); - - ecma_string_t *source_p = ecma_get_string_from_value (bc_p->source); - uint16_t flags = bc_p->header.status_flags; - - ecma_stringbuilder_t result = ecma_stringbuilder_create (); - ecma_stringbuilder_append_byte (&result, LIT_CHAR_SLASH); - ecma_stringbuilder_append (&result, source_p); - ecma_stringbuilder_append_byte (&result, LIT_CHAR_SLASH); - - if (flags & RE_FLAG_GLOBAL) - { - ecma_stringbuilder_append_byte (&result, LIT_CHAR_LOWERCASE_G); - } - - if (flags & RE_FLAG_IGNORE_CASE) - { - ecma_stringbuilder_append_byte (&result, LIT_CHAR_LOWERCASE_I); - } - - if (flags & RE_FLAG_MULTILINE) - { - ecma_stringbuilder_append_byte (&result, LIT_CHAR_LOWERCASE_M); - } - - return ecma_make_string_value (ecma_stringbuilder_finalize (&result)); -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_regexp_prototype_to_string */ -#if JERRY_ESNEXT -/** - * Helper function to determine if method is the builtin exec method - * - * @return true, if function is the builtin exec method - * false, otherwise - */ -extern inline bool JERRY_ATTR_ALWAYS_INLINE -ecma_builtin_is_regexp_exec (ecma_extended_object_t *obj_p) -{ - return (ecma_get_object_type (&obj_p->object) == ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION - && obj_p->u.built_in.routine_id == ECMA_REGEXP_PROTOTYPE_ROUTINE_EXEC); -} /* ecma_builtin_is_regexp_exec */ -#endif /* JERRY_ESNEXT */ - -#if JERRY_ESNEXT /** * The RegExp.prototype object's 'matchAll' routine * @@ -628,7 +530,6 @@ ecma_builtin_regexp_prototype_match_all (ecma_object_t *regexp_obj_p, /**< this return ecma_make_object_value (result_obj); } /* ecma_builtin_regexp_prototype_match_all */ -#endif /* JERRY_ESNEXT */ /** * Dispatcher of the Regexp built-in's routines @@ -645,12 +546,6 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< { JERRY_UNUSED (arguments_number); -#if !JERRY_ESNEXT - bool require_regexp = builtin_routine_id <= ECMA_REGEXP_PROTOTYPE_ROUTINE_TO_STRING; -#else /* JERRY_ESNEXT */ - bool require_regexp = builtin_routine_id < ECMA_REGEXP_PROTOTYPE_ROUTINE_TEST; -#endif /* JERRY_ESNEXT */ - ecma_object_t *obj_p = NULL; /* 1. && 2. */ @@ -658,7 +553,8 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< { obj_p = ecma_get_object_from_value (this_arg); - if (require_regexp && !ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_REGEXP)) + if (builtin_routine_id < ECMA_REGEXP_PROTOTYPE_ROUTINE_TEST + && !ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_REGEXP)) { obj_p = NULL; } @@ -689,7 +585,6 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< { return ecma_builtin_regexp_prototype_to_string (obj_p); } -#if JERRY_ESNEXT case ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SEARCH: { return ecma_regexp_search_helper (this_arg, arguments_list_p[0]); @@ -749,7 +644,6 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) obj_p; return ecma_builtin_regexp_prototype_flags_helper (re_obj_p, builtin_routine_id); } -#endif /* JERRY_ESNEXT */ default: { JERRY_UNREACHABLE (); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h index 9b60457e..51486e9f 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h @@ -24,7 +24,6 @@ /* ECMA-262 v5, 15.10.6.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, ECMA_BUILTIN_ID_REGEXP, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#if JERRY_ESNEXT ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_FLAGS, ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_FLAGS, ECMA_PROPERTY_FLAG_CONFIGURABLE) ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SOURCE, ECMA_REGEXP_PROTOTYPE_ROUTINE_GET_SOURCE, ECMA_PROPERTY_FLAG_CONFIGURABLE) @@ -52,22 +51,6 @@ ROUTINE (LIT_GLOBAL_SYMBOL_SEARCH, ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SEARCH, ROUTINE (LIT_GLOBAL_SYMBOL_SPLIT, ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_SPLIT, 2, 2) ROUTINE (LIT_GLOBAL_SYMBOL_MATCH, ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH, 1, 1) ROUTINE (LIT_GLOBAL_SYMBOL_MATCH_ALL, ECMA_REGEXP_PROTOTYPE_ROUTINE_SYMBOL_MATCH_ALL, 1, 1) -#else /* !JERRY_ESNEXT */ -/* ECMA-262 v5, 15.10.7.1 */ -STRING_VALUE (LIT_MAGIC_STRING_SOURCE, LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP, ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.10.7.2 */ -SIMPLE_VALUE (LIT_MAGIC_STRING_GLOBAL, ECMA_VALUE_FALSE, ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.10.7.3 */ -SIMPLE_VALUE (LIT_MAGIC_STRING_IGNORECASE_UL, ECMA_VALUE_FALSE, ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.10.7.4 */ -SIMPLE_VALUE (LIT_MAGIC_STRING_MULTILINE, ECMA_VALUE_FALSE, ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.10.7.5 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LASTINDEX_UL, 0, ECMA_PROPERTY_FLAG_WRITABLE) -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_ANNEXB ROUTINE (LIT_MAGIC_STRING_COMPILE, ECMA_REGEXP_PROTOTYPE_ROUTINE_COMPILE, 2, 2) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c index 83070766..5a1d554d 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.c @@ -20,8 +20,6 @@ #include "ecma-iterator-object.h" #include "ecma-objects.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -184,5 +182,3 @@ free_variables: * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h index d2eebddb..612bf697 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-string-iterator-prototype.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_REGEXP_STRING_ITERATOR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) @@ -29,6 +27,4 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_regexp_string_iterator_prototype_object_next, 0, 0) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c index a2dc4353..0b3cfe58 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c @@ -49,13 +49,9 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**< { ecma_value_t pattern_value = ECMA_VALUE_UNDEFINED; ecma_value_t flags_value = ECMA_VALUE_UNDEFINED; -#if JERRY_ESNEXT bool create_regexp_from_bc = false; bool free_arguments = false; ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target_p); -#else /* !JERRY_ESNEXT */ - ecma_object_t *new_target_p = NULL; -#endif /* JERRY_ESNEXT */ if (arguments_list_len > 0) { @@ -68,7 +64,6 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**< } } -#if JERRY_ESNEXT ecma_value_t regexp_value = ecma_op_is_regexp (pattern_value); if (ECMA_IS_VALUE_ERROR (regexp_value)) @@ -144,31 +139,18 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**< free_arguments = true; } -#else /* !JERRY_ESNEXT */ - if (ecma_object_is_regexp_object (pattern_value)) - { - if (ecma_is_value_undefined (flags_value)) - { - return ecma_copy_value (pattern_value); - } - - return ecma_raise_type_error (ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION); - } -#endif /* JERRY_ESNEXT */ ecma_value_t ret_value = ECMA_VALUE_ERROR; ecma_object_t *new_target_obj_p = ecma_op_regexp_alloc (new_target_p); if (JERRY_LIKELY (new_target_obj_p != NULL)) { -#if JERRY_ESNEXT if (create_regexp_from_bc) { ret_value = ecma_op_create_regexp_from_bytecode (new_target_obj_p, bc_p); JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (ret_value)); } else -#endif /* JERRY_ESNEXT */ { ret_value = ecma_op_create_regexp_from_pattern (new_target_obj_p, pattern_value, flags_value); @@ -179,13 +161,11 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**< } } -#if JERRY_ESNEXT if (free_arguments) { ecma_free_value (pattern_value); ecma_free_value (flags_value); } -#endif /* JERRY_ESNEXT */ return ret_value; } /* ecma_builtin_regexp_dispatch_helper */ @@ -216,7 +196,6 @@ ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /* return ecma_builtin_regexp_dispatch_helper (arguments_list_p, arguments_list_len); } /* ecma_builtin_regexp_dispatch_construct */ -#if JERRY_ESNEXT /** * 21.2.4.2 get RegExp [ @@species ] accessor * @@ -228,7 +207,6 @@ ecma_builtin_regexp_species_get (ecma_value_t this_value) /**< This Value */ { return ecma_copy_value (this_value); } /* ecma_builtin_regexp_species_get */ -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h index 882e42ca..a9fa8922 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h @@ -25,13 +25,10 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 2, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.10.5.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_REGEXP_PROTOTYPE, ECMA_PROPERTY_FIXED) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_REGEXP_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) /* ECMA-262 v6, 21.2.4.2 */ ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_SPECIES, ecma_builtin_regexp_species_get, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_REGEXP */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c index c7808239..5f2158cf 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c @@ -17,8 +17,6 @@ #include "ecma-builtins.h" #include "ecma-iterator-object.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -205,5 +203,3 @@ ecma_builtin_string_iterator_prototype_dispatch_routine (uint8_t builtin_routine * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h index e5d043d1..adc799d1 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.inc.h @@ -19,14 +19,10 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_STRING_ITERATOR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_BUILTIN_STRING_ITERATOR_PROTOTYPE_OBJECT_NEXT, 0, 0) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c index fb46e02e..8616fbf5 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c @@ -291,7 +291,6 @@ static ecma_value_t ecma_builtin_string_prototype_object_match (ecma_value_t this_argument, /**< this argument */ ecma_value_t regexp_arg) /**< routine's argument */ { -#if JERRY_ESNEXT /* 3. */ if (!(ecma_is_value_undefined (regexp_arg) || ecma_is_value_null (regexp_arg))) { @@ -351,37 +350,8 @@ ecma_builtin_string_prototype_object_match (ecma_value_t this_argument, /**< thi ecma_free_value (new_regexp); return ret_value; - -#else /* !JERRY_ESNEXT */ - if (ecma_object_is_regexp_object (regexp_arg)) - { - return ecma_regexp_match_helper (regexp_arg, this_argument); - } - - ecma_object_t *regexp_obj_p = ecma_op_regexp_alloc (NULL); - - if (JERRY_UNLIKELY (regexp_obj_p == NULL)) - { - return ECMA_VALUE_ERROR; - } - - ecma_value_t new_regexp = ecma_op_create_regexp_from_pattern (regexp_obj_p, regexp_arg, ECMA_VALUE_UNDEFINED); - - if (ECMA_IS_VALUE_ERROR (new_regexp)) - { - ecma_deref_object (regexp_obj_p); - return new_regexp; - } - - ecma_value_t result = ecma_regexp_match_helper (new_regexp, this_argument); - - ecma_free_value (new_regexp); - - return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_string_prototype_object_match */ -#if JERRY_ESNEXT /** * The String.prototype object's 'matchAll' routine * @@ -505,7 +475,6 @@ ecma_builtin_string_prototype_object_match_all (ecma_value_t this_argument, /**< return ret_value; } /* ecma_builtin_string_prototype_object_match_all */ -#endif /* JERRY_ESNEXT */ /** * The String.prototype object's 'replace' and 'replaceAll' routine @@ -524,7 +493,6 @@ ecma_builtin_string_prototype_object_replace_helper (ecma_value_t this_value, /* ecma_value_t replace_value, /**< routine's second argument */ bool replace_all) { -#if JERRY_ESNEXT if (!(ecma_is_value_undefined (search_value) || ecma_is_value_null (search_value))) { if (replace_all) @@ -590,12 +558,6 @@ ecma_builtin_string_prototype_object_replace_helper (ecma_value_t this_value, /* return replace_result; } } -#else /* !JERRY_ESNEXT */ - if (ecma_object_is_regexp_object (search_value)) - { - return ecma_regexp_replace_helper (search_value, this_value, replace_value); - } -#endif /* JERRY_ESNEXT */ ecma_string_t *input_str_p = ecma_op_to_string (this_value); @@ -762,7 +724,6 @@ static ecma_value_t ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this argument */ ecma_value_t regexp_value) /**< routine's argument */ { -#if JERRY_ESNEXT if (!(ecma_is_value_undefined (regexp_value) || ecma_is_value_null (regexp_value))) { ecma_object_t *obj_p = ecma_get_object_from_value (ecma_op_to_object (regexp_value)); @@ -781,12 +742,6 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this return search_result; } } -#else /* !JERRY_ESNEXT */ - if (ecma_object_is_regexp_object (regexp_value)) - { - return ecma_regexp_search_helper (regexp_value, this_value); - } -#endif /* JERRY_ESNEXT */ ecma_value_t result = ECMA_VALUE_ERROR; @@ -799,7 +754,8 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this ecma_string_t *pattern_p = ecma_regexp_read_pattern_str_helper (regexp_value); if (pattern_p == NULL) { - goto cleanup_string; + ecma_deref_ecma_string (string_p); + return result; } ecma_object_t *new_regexp_obj_p = ecma_op_regexp_alloc (NULL); @@ -808,7 +764,7 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this { ecma_deref_ecma_string (string_p); ecma_deref_ecma_string (pattern_p); - return ECMA_VALUE_ERROR; + return result; } ecma_value_t new_regexp = @@ -818,22 +774,17 @@ ecma_builtin_string_prototype_object_search (ecma_value_t this_value, /**< this if (ECMA_IS_VALUE_ERROR (new_regexp)) { + ecma_deref_ecma_string (string_p); ecma_deref_object (new_regexp_obj_p); - goto cleanup_string; + return result; } -#if !JERRY_ESNEXT - result = ecma_regexp_search_helper (new_regexp, ecma_make_string_value (string_p)); - ecma_deref_object (ecma_get_object_from_value (new_regexp)); -#else /* JERRY_ESNEXT */ ecma_object_t *regexp_obj_p = ecma_get_object_from_value (new_regexp); ecma_value_t this_str_value = ecma_make_string_value (string_p); result = ecma_op_invoke_by_symbol_id (new_regexp, LIT_GLOBAL_SYMBOL_SEARCH, &this_str_value, 1); ecma_deref_object (regexp_obj_p); -#endif /* !JERRY_ESNEXT */ - -cleanup_string: ecma_deref_ecma_string (string_p); + return result; } /* ecma_builtin_string_prototype_object_search */ @@ -926,7 +877,6 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_value, /**< this a ecma_value_t separator_value, /**< separator */ ecma_value_t limit_value) /**< limit */ { -#if JERRY_ESNEXT if (!(ecma_is_value_undefined (separator_value) || ecma_is_value_null (separator_value))) { ecma_object_t *obj_p = ecma_get_object_from_value (ecma_op_to_object (separator_value)); @@ -947,12 +897,6 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_value, /**< this a return split_result; } } -#else /* !JERRY_ESNEXT */ - if (ecma_object_is_regexp_object (separator_value)) - { - return ecma_regexp_split_helper (separator_value, this_value, limit_value); - } -#endif /* JERRY_ESNEXT */ ecma_value_t result = ECMA_VALUE_ERROR; @@ -1180,7 +1124,6 @@ ecma_builtin_string_prototype_object_conversion_helper (ecma_string_t *input_str { lit_code_point_t cp = lit_cesu8_read_next (&input_curr_p); -#if JERRY_ESNEXT if (lit_is_code_point_utf16_high_surrogate (cp) && input_curr_p < input_str_end_p) { const ecma_char_t next_ch = lit_cesu8_peek_next (input_curr_p); @@ -1190,7 +1133,6 @@ ecma_builtin_string_prototype_object_conversion_helper (ecma_string_t *input_str input_curr_p += LIT_UTF8_MAX_BYTES_IN_CODE_UNIT; } } -#endif /* JERRY_ESNEXT */ if (lower_case) { @@ -1224,8 +1166,6 @@ ecma_builtin_string_prototype_object_trim (ecma_string_t *original_string_p) /** return ecma_make_string_value (trimmed_string_p); } /* ecma_builtin_string_prototype_object_trim */ -#if JERRY_ESNEXT - /** * The String.prototype object's 'repeat' routine * @@ -1338,8 +1278,6 @@ ecma_builtin_string_prototype_object_code_point_at (ecma_string_t *this_string_p return ecma_make_uint32_value (lit_convert_surrogate_pair_to_code_point (first, second)); } /* ecma_builtin_string_prototype_object_code_point_at */ -#endif /* JERRY_ESNEXT */ - #if JERRY_BUILTIN_ANNEXB /** @@ -1403,8 +1341,6 @@ ecma_builtin_string_prototype_object_substr (ecma_string_t *this_string_p, /**< #endif /* JERRY_BUILTIN_ANNEXB */ -#if JERRY_ESNEXT - /** * The String.prototype object's @@iterator routine * @@ -1423,8 +1359,6 @@ ecma_builtin_string_prototype_object_iterator (ecma_value_t to_string) /**< this ECMA_ITERATOR_VALUES); } /* ecma_builtin_string_prototype_object_iterator */ -#endif /* JERRY_ESNEXT */ - /** * Dispatcher of the built-in's routines * @@ -1458,12 +1392,10 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< return ecma_builtin_string_prototype_object_match (this_arg, arg1); } -#if JERRY_ESNEXT if (builtin_routine_id == ECMA_STRING_PROTOTYPE_MATCH_ALL) { return ecma_builtin_string_prototype_object_match_all (this_arg, arg1); } -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_REGEXP */ if (builtin_routine_id <= ECMA_STRING_PROTOTYPE_CHAR_CODE_AT) @@ -1478,12 +1410,11 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< { return ecma_builtin_string_prototype_object_replace_helper (this_arg, arg1, arg2, false); } -#if JERRY_ESNEXT + else if (builtin_routine_id == ECMA_STRING_PROTOTYPE_REPLACE_ALL) { return ecma_builtin_string_prototype_object_replace_helper (this_arg, arg1, arg2, true); } -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_REGEXP */ ecma_string_t *string_p = ecma_op_to_string (this_arg); @@ -1515,11 +1446,9 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< } case ECMA_STRING_PROTOTYPE_LAST_INDEX_OF: case ECMA_STRING_PROTOTYPE_INDEX_OF: -#if JERRY_ESNEXT case ECMA_STRING_PROTOTYPE_STARTS_WITH: case ECMA_STRING_PROTOTYPE_INCLUDES: case ECMA_STRING_PROTOTYPE_ENDS_WITH: -#endif /* JERRY_ESNEXT */ { ecma_string_index_of_mode_t mode; mode = (ecma_string_index_of_mode_t) (builtin_routine_id - ECMA_STRING_PROTOTYPE_LAST_INDEX_OF); @@ -1569,7 +1498,6 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< break; } #endif /* JERRY_BUILTIN_ANNEXB */ -#if JERRY_ESNEXT case ECMA_STRING_PROTOTYPE_REPEAT: { ret_value = ecma_builtin_string_prototype_object_repeat (string_p, arg1); @@ -1591,7 +1519,6 @@ ecma_builtin_string_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< ret_value = ecma_string_pad (to_string_val, arg1, arg2, builtin_routine_id == ECMA_STRING_PROTOTYPE_PAD_START); break; } -#endif /* JERRY_ESNEXT */ default: { JERRY_UNREACHABLE (); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h index ba3278f1..3e54d262 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h @@ -49,9 +49,7 @@ ROUTINE (LIT_MAGIC_STRING_LOCALE_COMPARE_UL, ECMA_STRING_PROTOTYPE_LOCALE_COMPAR #if JERRY_BUILTIN_REGEXP ROUTINE (LIT_MAGIC_STRING_MATCH, ECMA_STRING_PROTOTYPE_MATCH, 1, 1) ROUTINE (LIT_MAGIC_STRING_REPLACE, ECMA_STRING_PROTOTYPE_REPLACE, 2, 2) -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_REPLACE_ALL, ECMA_STRING_PROTOTYPE_REPLACE_ALL, 2, 2) -#endif /* JERRY_ESNEXT */ ROUTINE (LIT_MAGIC_STRING_SEARCH, ECMA_STRING_PROTOTYPE_SEARCH, 1, 1) #endif /* JERRY_BUILTIN_REGEXP */ @@ -67,7 +65,6 @@ ROUTINE (LIT_MAGIC_STRING_TRIM, ECMA_STRING_PROTOTYPE_TRIM, 0, 0) ROUTINE (LIT_MAGIC_STRING_SUBSTR, ECMA_STRING_PROTOTYPE_SUBSTR, 2, 2) #endif /* JERRY_BUILTIN_ANNEXB */ -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_REPEAT, ECMA_STRING_PROTOTYPE_REPEAT, 1, 1) ROUTINE (LIT_MAGIC_STRING_STARTS_WITH, ECMA_STRING_PROTOTYPE_STARTS_WITH, 2, 1) ROUTINE (LIT_MAGIC_STRING_INCLUDES, ECMA_STRING_PROTOTYPE_INCLUDES, 2, 1) @@ -82,7 +79,6 @@ INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TRIM_START, LIT_MAGIC_STRING_TRIM_START, EC INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TRIM_LEFT, LIT_MAGIC_STRING_TRIM_START, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TRIM_END, LIT_MAGIC_STRING_TRIM_END, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TRIM_RIGHT, LIT_MAGIC_STRING_TRIM_END, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_STRING */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string.c b/jerry-core/ecma/builtin-objects/ecma-builtin-string.c index 13207c42..b0276312 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-string.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string.c @@ -22,12 +22,10 @@ #include "ecma-helpers.h" #include "ecma-objects.h" #include "ecma-string-object.h" - -#include "lit-strings.h" -#if JERRY_ESNEXT #include "ecma-symbol-object.h" -#endif /* JERRY_ESNEXT */ + #include "jrt.h" +#include "lit-strings.h" #if JERRY_BUILTIN_STRING @@ -118,8 +116,6 @@ ecma_builtin_string_object_from_char_code (const ecma_value_t args[], /**< argum return isError ? ECMA_VALUE_ERROR : ecma_make_string_value (ret_string_p); } /* ecma_builtin_string_object_from_char_code */ -#if JERRY_ESNEXT - /** * The String object's 'raw' routine * @@ -332,8 +328,6 @@ ecma_builtin_string_object_from_code_point (const ecma_value_t args[], /**< argu return ecma_make_string_value (ret_str_p); } /* ecma_builtin_string_object_from_code_point */ -#endif /* JERRY_ESNEXT */ - /** * Handle calling [[Call]] of built-in String object * @@ -355,13 +349,11 @@ ecma_builtin_string_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar { ret_value = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY); } -#if JERRY_ESNEXT /* 2.a */ else if (ecma_is_value_symbol (arguments_list_p[0])) { ret_value = ecma_get_symbol_descriptive_string (arguments_list_p[0]); } -#endif /* JERRY_ESNEXT */ /* 2.b */ else { @@ -412,7 +404,6 @@ ecma_builtin_string_dispatch_routine (uint8_t builtin_routine_id, /**< built-in { return ecma_builtin_string_object_from_char_code (arguments_list_p, arguments_number); } -#if JERRY_ESNEXT case ECMA_BUILTIN_STRING_OBJECT_FROM_CODE_POINT: { return ecma_builtin_string_object_from_code_point (arguments_list_p, arguments_number); @@ -421,7 +412,6 @@ ecma_builtin_string_dispatch_routine (uint8_t builtin_routine_id, /**< built-in { return ecma_builtin_string_object_raw (arguments_list_p, arguments_number); } -#endif /* JERRY_ESNEXT */ default: { JERRY_UNREACHABLE (); diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h index 8bc41343..2178acf1 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h @@ -31,19 +31,13 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.7.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_STRING_PROTOTYPE, ECMA_PROPERTY_FIXED) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_STRING_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_FROM_CHAR_CODE_UL, ECMA_BUILTIN_STRING_OBJECT_FROM_CHAR_CODE, NON_FIXED, 1) - -#if JERRY_ESNEXT ROUTINE (LIT_MAGIC_STRING_FROM_CODE_POINT_UL, ECMA_BUILTIN_STRING_OBJECT_FROM_CODE_POINT, NON_FIXED, 1) ROUTINE (LIT_MAGIC_STRING_RAW, ECMA_BUILTIN_STRING_OBJECT_RAW, NON_FIXED, 1) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_STRING */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c index c508148b..df4c9d5f 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c @@ -25,8 +25,6 @@ #include "jrt.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -111,5 +109,3 @@ ecma_builtin_symbol_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h index 585b86b6..9b0daa0c 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Object properties: * (property name, object pointer getter) */ @@ -35,6 +33,5 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_SYMBOL_UL, ECMA_ /* ECMA-262, v11, 19.4.3.2 */ ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_DESCRIPTION, ECMA_SYMBOL_PROTOTYPE_DESCRIPTION, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c index 38c13297..3ce75f9b 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c @@ -27,8 +27,6 @@ #include "jcontext.h" #include "jrt.h" -#if JERRY_ESNEXT - #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -253,5 +251,3 @@ ecma_builtin_symbol_key_for (ecma_value_t this_arg, /**< this argument */ * @} * @} */ - -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h index 1d34b3a4..9fecbd4f 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.inc.h @@ -19,8 +19,6 @@ #include "ecma-builtin-helpers-macro-defines.inc.h" -#if JERRY_ESNEXT - /* Number properties: * (property name, number value, writable, enumerable, configurable) */ @@ -79,6 +77,4 @@ SYMBOL_VALUE (LIT_MAGIC_STRING_MATCH_ALL, LIT_GLOBAL_SYMBOL_MATCH_ALL) ROUTINE (LIT_MAGIC_STRING_FOR, ecma_builtin_symbol_for, 1, 1) ROUTINE (LIT_MAGIC_STRING_KEY_FOR, ecma_builtin_symbol_key_for, 1, 1) -#endif /* JERRY_ESNEXT */ - #include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c index 6227ef60..449c0db6 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c @@ -67,9 +67,6 @@ ecma_value_t ecma_builtin_syntax_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ uint32_t arguments_list_len) /**< number of arguments */ { -#if !JERRY_ESNEXT - return ecma_builtin_syntax_error_dispatch_call (arguments_list_p, arguments_list_len); -#else /* JERRY_ESNEXT */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE); @@ -89,7 +86,6 @@ ecma_builtin_syntax_error_dispatch_construct (const ecma_value_t *arguments_list ecma_deref_object (proto_p); return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_syntax_error_dispatch_construct */ /** diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h index 18df8255..bee730cf 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h @@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.11.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_SYNTAX_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_ERRORS */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c index a16fce50..c18cdaad 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c @@ -67,9 +67,6 @@ ecma_value_t ecma_builtin_type_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ uint32_t arguments_list_len) /**< number of arguments */ { -#if !JERRY_ESNEXT - return ecma_builtin_type_error_dispatch_call (arguments_list_p, arguments_list_len); -#else /* JERRY_ESNEXT */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE); @@ -89,7 +86,6 @@ ecma_builtin_type_error_dispatch_construct (const ecma_value_t *arguments_list_p ecma_deref_object (proto_p); return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_type_error_dispatch_construct */ /** diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h index a4508f91..d2bb8e33 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h @@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.11.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_TYPE_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_ERRORS */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c b/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c index 52d7a2b6..1c7333e9 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c @@ -67,9 +67,6 @@ ecma_value_t ecma_builtin_uri_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ uint32_t arguments_list_len) /**< number of arguments */ { -#if !JERRY_ESNEXT - return ecma_builtin_uri_error_dispatch_call (arguments_list_p, arguments_list_len); -#else /* JERRY_ESNEXT */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE); @@ -89,7 +86,6 @@ ecma_builtin_uri_error_dispatch_construct (const ecma_value_t *arguments_list_p, ecma_deref_object (proto_p); return result; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_uri_error_dispatch_construct */ /** diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h index fd98a1d7..ed1d3d5a 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h @@ -31,10 +31,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, 1, ECMA_PROPERTY_FLAG_DEFAULT_LENGTH) /* ECMA-262 v5, 15.11.3.1 */ OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE, ECMA_PROPERTY_FIXED) - -#if JERRY_ESNEXT STRING_VALUE (LIT_MAGIC_STRING_NAME, LIT_MAGIC_STRING_URI_ERROR_UL, ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_ERRORS */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h b/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h index c8030b6b..5695e2d8 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h @@ -31,12 +31,10 @@ typedef enum ECMA_BUILTIN_PROPERTY_SIMPLE, /**< simple value property */ ECMA_BUILTIN_PROPERTY_NUMBER, /**< number value property */ ECMA_BUILTIN_PROPERTY_STRING, /**< string value property */ -#if JERRY_ESNEXT ECMA_BUILTIN_PROPERTY_SYMBOL, /**< symbol value property */ ECMA_BUILTIN_PROPERTY_INTRINSIC_PROPERTY, /**< intrinsic routine property */ ECMA_BUILTIN_PROPERTY_ACCESSOR_BUILTIN_FUNCTION, /**< full accessor property with builtin function object getter/setter pair */ -#endif /* JERRY_ESNEXT */ ECMA_BUILTIN_PROPERTY_OBJECT, /**< builtin object property */ ECMA_BUILTIN_PROPERTY_ROUTINE, /**< routine property */ ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_WRITE, /**< full accessor property */ @@ -51,11 +49,9 @@ typedef enum { ECMA_BUILTIN_NUMBER_MAX = 256, /**< value of ECMA_NUMBER_MAX_VALUE */ ECMA_BUILTIN_NUMBER_MIN, /**< value of ECMA_NUMBER_MIN_VALUE */ -#if JERRY_ESNEXT ECMA_BUILTIN_NUMBER_EPSILON, /**< value of ECMA_NUMBER_EPSILON */ ECMA_BUILTIN_NUMBER_MAX_SAFE_INTEGER, /**< value of ECMA_NUMBER_MAX_SAFE_INTEGER */ ECMA_BUILTIN_NUMBER_MIN_SAFE_INTEGER, /**< value of ECMA_NUMBER_MIN_SAFE_INTEGER */ -#endif /* JERRY_ESNEXT */ ECMA_BUILTIN_NUMBER_E, /**< value of ECMA_NUMBER_E */ ECMA_BUILTIN_NUMBER_PI, /**< value of ECMA_NUMBER_PI */ ECMA_BUILTIN_NUMBER_LN10, /**< value of ECMA_NUMBER_LN10 */ diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.c b/jerry-core/ecma/builtin-objects/ecma-builtins.c index 61692cb0..c1450071 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtins.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtins.c @@ -455,40 +455,6 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj } #endif /* JERRY_BUILTIN_BOOLEAN */ -#if !JERRY_ESNEXT -#if JERRY_BUILTIN_DATE - case ECMA_BUILTIN_ID_DATE_PROTOTYPE: - { - JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_BUILT_IN_CLASS); - ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p; - - ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_DATE; - - ecma_number_t *prim_prop_num_value_p = ecma_alloc_number (); - *prim_prop_num_value_p = ecma_number_make_nan (); - ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.cls.u3.value, prim_prop_num_value_p); - break; - } -#endif /* JERRY_BUILTIN_DATE */ - -#if JERRY_BUILTIN_REGEXP - case ECMA_BUILTIN_ID_REGEXP_PROTOTYPE: - { - JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_BUILT_IN_CLASS); - ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p; - - ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_REGEXP; - - re_compiled_code_t *bc_p = - re_compile_bytecode (ecma_get_magic_string (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP), RE_FLAG_EMPTY); - - JERRY_ASSERT (bc_p != NULL); - - ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.cls.u3.value, bc_p); - break; - } -#endif /* JERRY_BUILTIN_REGEXP */ -#endif /* !JERRY_ESNEXT */ default: { JERRY_ASSERT (obj_type != ECMA_OBJECT_TYPE_BUILT_IN_CLASS); @@ -550,15 +516,13 @@ ecma_builtin_create_global_object (void) /* Temporary self reference for GC mark. */ ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, object_p); -#if JERRY_ESNEXT global_object_p->global_scope_cp = global_object_p->global_env_cp; -#endif /* JERRY_ESNEXT */ ecma_object_t *global_lex_env_p = ecma_create_object_lex_env (NULL, object_p); + ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, global_lex_env_p); -#if JERRY_ESNEXT global_object_p->global_scope_cp = global_object_p->global_env_cp; -#endif /* JERRY_ESNEXT */ + ecma_deref_object (global_lex_env_p); ecma_object_t *prototype_object_p; @@ -727,8 +691,6 @@ ecma_builtin_make_function_object_for_setter_accessor (ecma_object_t *builtin_ob ECMA_BUILTIN_ROUTINE_SETTER); } /* ecma_builtin_make_function_object_for_setter_accessor */ -#if JERRY_ESNEXT - /** * Create specification defined properties for built-in native handlers. * @@ -769,8 +731,6 @@ ecma_builtin_native_handler_try_to_instantiate_property (ecma_object_t *object_p return prop_p; } /* ecma_builtin_native_handler_try_to_instantiate_property */ -#endif /* JERRY_ESNEXT */ - /** * Lazy instantiation of builtin routine property of builtin object * @@ -789,12 +749,10 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**< ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p; -#if JERRY_ESNEXT if (JERRY_UNLIKELY (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER)) { return ecma_builtin_native_handler_try_to_instantiate_property (object_p, property_name_p); } -#endif /* !JERRY_ESNEXT */ if (ecma_string_is_length (property_name_p)) { @@ -803,7 +761,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**< */ ecma_property_t *len_prop_p; -#if JERRY_ESNEXT uint8_t *bitset_p = &ext_func_p->u.built_in.u2.routine_flags; if (*bitset_p & ECMA_BUILTIN_ROUTINE_LENGTH_INITIALIZED) @@ -816,12 +773,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**< * as it is configurable and so can be deleted (ECMA-262 v6, 19.2.4.1) */ ecma_property_value_t *len_prop_value_p = ecma_create_named_data_property (object_p, property_name_p, ECMA_PROPERTY_BUILT_IN_CONFIGURABLE, &len_prop_p); -#else /* !JERRY_ESNEXT */ - /* We don't need to mark that the property was already lazy instantiated, - * as it is non-configurable and so can't be deleted (ECMA-262 v5, 13.2.5) */ - ecma_property_value_t *len_prop_value_p = - ecma_create_named_data_property (object_p, property_name_p, ECMA_PROPERTY_BUILT_IN_FIXED, &len_prop_p); -#endif /* JERRY_ESNEXT */ uint8_t length = 0; @@ -845,7 +796,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**< return len_prop_p; } -#if JERRY_ESNEXT /* * Lazy instantiation of 'name' property */ @@ -918,7 +868,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**< return name_prop_p; } -#endif /* JERRY_ESNEXT */ return NULL; } /* ecma_builtin_routine_try_to_instantiate_property */ @@ -937,12 +886,10 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object * { lit_magic_string_id_t magic_string_id = ecma_get_string_magic (property_name_p); -#if JERRY_ESNEXT if (JERRY_UNLIKELY (ecma_prop_name_is_symbol (property_name_p)) && property_name_p->u.hash & ECMA_SYMBOL_FLAG_GLOBAL) { magic_string_id = (property_name_p->u.hash >> ECMA_SYMBOL_FLAGS_SHIFT); } -#endif /* JERRY_ESNEXT */ if (magic_string_id == LIT_MAGIC_STRING__COUNT) { @@ -1034,11 +981,9 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object * static const ecma_number_t builtin_number_list[] = { ECMA_NUMBER_MAX_VALUE, ECMA_NUMBER_MIN_VALUE, -#if JERRY_ESNEXT ECMA_NUMBER_EPSILON, ECMA_NUMBER_MAX_SAFE_INTEGER, ECMA_NUMBER_MIN_SAFE_INTEGER, -#endif /* JERRY_ESNEXT */ ECMA_NUMBER_E, ECMA_NUMBER_PI, ECMA_NUMBER_LN10, @@ -1083,7 +1028,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object * value = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->value); break; } -#if JERRY_ESNEXT case ECMA_BUILTIN_PROPERTY_SYMBOL: { lit_magic_string_id_t symbol_id = (lit_magic_string_id_t) curr_property_p->value; @@ -1108,7 +1052,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object * ecma_ref_object (setter_p); break; } -#endif /* JERRY_ESNEXT */ case ECMA_BUILTIN_PROPERTY_OBJECT: { ecma_object_t *builtin_object_p; @@ -1182,8 +1125,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object * return prop_p; } /* ecma_builtin_try_to_instantiate_property */ -#if JERRY_ESNEXT - /** * Delete configurable properties of native handlers. */ @@ -1241,8 +1182,6 @@ ecma_builtin_routine_delete_built_in_property (ecma_object_t *object_p, /**< obj *bitset_p |= ECMA_BUILTIN_ROUTINE_NAME_INITIALIZED; } /* ecma_builtin_routine_delete_built_in_property */ -#endif /* JERRY_ESNEXT */ - /** * Delete configurable properties of built-ins. */ @@ -1252,7 +1191,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */ { lit_magic_string_id_t magic_string_id = ecma_get_string_magic (property_name_p); -#if JERRY_ESNEXT if (JERRY_UNLIKELY (ecma_prop_name_is_symbol (property_name_p))) { if (property_name_p->u.hash & ECMA_SYMBOL_FLAG_GLOBAL) @@ -1260,7 +1198,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */ magic_string_id = (property_name_p->u.hash >> ECMA_SYMBOL_FLAGS_SHIFT); } } -#endif /* JERRY_ESNEXT */ ecma_built_in_props_t *built_in_props_p; ecma_object_type_t object_type = ecma_get_object_type (object_p); @@ -1307,8 +1244,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */ *bitset_p |= bit_for_index; } /* ecma_builtin_delete_built_in_property */ -#if JERRY_ESNEXT - /** * List names of an Built-in native handler object's lazy instantiated properties, * adding them to corresponding string collections @@ -1334,8 +1269,6 @@ ecma_builtin_native_handler_list_lazy_property_names (ecma_object_t *object_p, / } } /* ecma_builtin_native_handler_list_lazy_property_names */ -#endif /* JERRY_ESNEXT */ - /** * List names of a built-in function's lazy instantiated properties * @@ -1356,7 +1289,6 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b return; } -#if JERRY_ESNEXT ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p; if (JERRY_UNLIKELY (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER)) @@ -1377,11 +1309,6 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_NAME)); prop_counter_p->string_named_props++; } -#else /* !JERRY_ESNEXT */ - /* 'length' property is non-enumerable (ECMA-262 v5, 15) */ - ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH)); - prop_counter_p->string_named_props++; -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_routine_list_lazy_property_names */ /** @@ -1421,10 +1348,8 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in uint8_t *bitset_p = built_in_props_p->u2.instantiated_bitset + 1; #endif /* JERRY_BUILTIN_REALMS */ -#if JERRY_ESNEXT uint8_t *symbol_bitset_p = bitset_p; bool has_symbol = true; -#endif /* JERRY_BUILTIN_REALMS */ if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_STRINGS)) { @@ -1432,9 +1357,7 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in uint8_t bitset = built_in_props_p->u2.instantiated_bitset[0]; uint32_t index = 0; -#if JERRY_ESNEXT has_symbol = false; -#endif /* JERRY_BUILTIN_REALMS */ while (curr_property_p->magic_string_id != LIT_MAGIC_STRING__COUNT) { @@ -1448,21 +1371,17 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in if (!(bitset & bit_for_index)) { -#if JERRY_ESNEXT if (JERRY_LIKELY (curr_property_p->magic_string_id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT)) { -#endif /* JERRY_ESNEXT */ ecma_value_t name = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->magic_string_id); ecma_collection_push_back (prop_names_p, name); prop_counter_p->string_named_props++; -#if JERRY_ESNEXT } else { JERRY_ASSERT (LIT_IS_GLOBAL_SYMBOL (curr_property_p->magic_string_id)); has_symbol = true; } -#endif /* JERRY_ESNEXT */ } curr_property_p++; @@ -1470,7 +1389,6 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in } } -#if JERRY_ESNEXT if (has_symbol && !(filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS)) { const ecma_builtin_property_descriptor_t *curr_property_p = ecma_builtin_property_list_references[builtin_id]; @@ -1498,7 +1416,6 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in index++; } } -#endif /* JERRY_ESNEXT */ } /* ecma_builtin_list_lazy_property_names */ /** @@ -1563,13 +1480,11 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */ if (ecma_builtin_function_is_routine (obj_p)) { -#if JERRY_ESNEXT if (JERRY_UNLIKELY (ext_obj_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER)) { ecma_builtin_handler_t handler = ecma_builtin_handler_get (ext_obj_p->u.built_in.routine_id); return handler (obj_p, arguments_list_p, arguments_list_len); } -#endif /* !JERRY_ESNEXT */ return ecma_builtin_dispatch_routine (ext_obj_p, this_arg_value, arguments_list_p, arguments_list_len); } diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.h b/jerry-core/ecma/builtin-objects/ecma-builtins.h index 96040de7..82761cdc 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtins.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtins.h @@ -38,8 +38,6 @@ typedef enum ECMA_BUILTIN_ID__COUNT /**< number of built-in objects */ } ecma_builtin_id_t; -#if JERRY_ESNEXT - /** * Special id for handlers (handlers are not regular built-ins, but * they use the same ecma_built_in_props_t structure as other built-ins) @@ -51,8 +49,6 @@ typedef enum */ #define ECMA_BUILTIN_GLOBAL_SYMBOL_COUNT (LIT_GLOBAL_SYMBOL__LAST - LIT_GLOBAL_SYMBOL__FIRST + 1) -#endif /* JERRY_ESNEXT */ - /** * Construct a routine value */ @@ -100,9 +96,7 @@ typedef struct ecma_value_t this_binding; /**< 'this' binding of this global object */ #endif /* JERRY_BUILTIN_REALMS */ jmem_cpointer_t global_env_cp; /**< global lexical environment */ -#if JERRY_ESNEXT jmem_cpointer_t global_scope_cp; /**< global lexical scope */ -#endif /* JERRY_ESNEXT */ jmem_cpointer_t builtin_objects[ECMA_BUILTIN_OBJECTS_COUNT]; /**< pointer to instances of built-in objects */ } ecma_global_object_t; @@ -120,9 +114,7 @@ ecma_value_t ecma_builtin_dispatch_construct (ecma_object_t *obj_p, ecma_property_t *ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); ecma_property_t *ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); -#if JERRY_ESNEXT void ecma_builtin_routine_delete_built_in_property (ecma_object_t *object_p, ecma_string_t *property_name_p); -#endif /* JERRY_ESNEXT */ void ecma_builtin_delete_built_in_property (ecma_object_t *object_p, ecma_string_t *property_name_p); void ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, ecma_collection_t *prop_names_p, diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h index 48cae1ca..449aef98 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h @@ -46,7 +46,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_ARRAY, array) #endif /* JERRY_BUILTIN_ARRAY */ -#if JERRY_ESNEXT #if JERRY_BUILTIN_DATE /* The Date.prototype object (20.3.4) */ BUILTIN (ECMA_BUILTIN_ID_DATE_PROTOTYPE, @@ -64,25 +63,6 @@ BUILTIN (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE, true, regexp_prototype) #endif /* JERRY_BUILTIN_REGEXP */ -#else /* !JERRY_ESNEXT */ -#if JERRY_BUILTIN_DATE -/* The Date.prototype object (15.9.4) */ -BUILTIN (ECMA_BUILTIN_ID_DATE_PROTOTYPE, - ECMA_OBJECT_TYPE_BUILT_IN_CLASS, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - date_prototype) -#endif /* JERRY_BUILTIN_DATE */ - -#if JERRY_BUILTIN_REGEXP -/* The RegExp.prototype object (15.10.6) */ -BUILTIN (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE, - ECMA_OBJECT_TYPE_BUILT_IN_CLASS, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - regexp_prototype) -#endif /* JERRY_BUILTIN_REGEXP */ -#endif /* !JERRY_ESNEXT */ #if JERRY_BUILTIN_STRING /* The String.prototype object (15.5.4) */ @@ -185,11 +165,7 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_REGEXP, regexp) #endif /* JERRY_BUILTIN_REGEXP */ -#if JERRY_ESNEXT #define ECMA_BUILTIN_NATIVE_ERROR_PROTOTYPE_ID ECMA_BUILTIN_ID_ERROR -#else /* !JERRY_ESNEXT */ -#define ECMA_BUILTIN_NATIVE_ERROR_PROTOTYPE_ID ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE -#endif /* JERRY_ESNEXT */ /* The Error object (15.11.1) */ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_ERROR, @@ -276,7 +252,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_TYPE_ERROR, true, type_error) -#if JERRY_ESNEXT /* The AggregateError.prototype object (15.11.6.5) */ BUILTIN (ECMA_BUILTIN_ID_AGGREGATE_ERROR_PROTOTYPE, ECMA_OBJECT_TYPE_BUILT_IN_GENERAL, @@ -290,7 +265,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_AGGREGATE_ERROR, ECMA_BUILTIN_NATIVE_ERROR_PROTOTYPE_ID, true, aggregate_error) -#endif /* JERRY_ESNEXT */ /* The URIError.prototype object (15.11.6.6) */ BUILTIN (ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE, @@ -503,8 +477,6 @@ BUILTIN (ECMA_BUILTIN_ID_BIGUINT64ARRAY_PROTOTYPE, #endif /* JERRY_BUILTIN_BIGINT */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT - BUILTIN (ECMA_BUILTIN_ID_PROMISE_PROTOTYPE, ECMA_OBJECT_TYPE_BUILT_IN_GENERAL, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, @@ -517,8 +489,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_PROMISE, true, promise) -#endif /* JERRY_ESNEXT */ - #if JERRY_BUILTIN_CONTAINER /* The Map prototype object (23.1.3) */ @@ -598,8 +568,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_PROXY, proxy) #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT - /* Intrinsic hidden builtin object */ BUILTIN (ECMA_BUILTIN_ID_INTRINSIC_OBJECT, ECMA_OBJECT_TYPE_BUILT_IN_GENERAL, @@ -742,8 +710,6 @@ BUILTIN (ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE, map_iterator_prototype) #endif /* JERRY_BUILTIN_CONTAINER */ -#endif /* JERRY_ESNEXT */ - #if JERRY_BUILTIN_BIGINT /* The %BigInt.prototype% object */ BUILTIN (ECMA_BUILTIN_ID_BIGINT_PROTOTYPE, diff --git a/jerry-core/ecma/operations/ecma-arguments-object.c b/jerry-core/ecma/operations/ecma-arguments-object.c index 4d289409..fd0c6798 100644 --- a/jerry-core/ecma/operations/ecma-arguments-object.c +++ b/jerry-core/ecma/operations/ecma-arguments-object.c @@ -297,25 +297,6 @@ ecma_op_arguments_object_try_to_lazy_instantiate_property (ecma_object_t *object return prop_p; } -#if !JERRY_ESNEXT - if (property_name_p == ecma_get_magic_string (LIT_MAGIC_STRING_CALLER)) - { - if (arguments_p->header.u.cls.u1.arguments_flags & ECMA_ARGUMENTS_OBJECT_MAPPED) - { - return NULL; - } - - ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER); - - ecma_create_named_accessor_property (object_p, - ecma_get_magic_string (LIT_MAGIC_STRING_CALLER), - thrower_p, - thrower_p, - ECMA_PROPERTY_BUILT_IN_FIXED, - &prop_p); - return prop_p; - } -#else /* JERRY_ESNEXT */ if (ecma_op_compare_string_to_global_symbol (property_name_p, LIT_GLOBAL_SYMBOL_ITERATOR) && !(flags & ECMA_ARGUMENTS_OBJECT_ITERATOR_INITIALIZED)) { @@ -331,7 +312,6 @@ ecma_op_arguments_object_try_to_lazy_instantiate_property (ecma_object_t *object ecma_deref_object (ecma_get_object_from_value (prop_value_p->value)); return prop_p; } -#endif /* !JERRY_ESNEXT */ return NULL; } /* ecma_op_arguments_object_try_to_lazy_instantiate_property */ @@ -362,7 +342,6 @@ ecma_op_arguments_delete_built_in_property (ecma_object_t *object_p, /**< the ob return; } -#if JERRY_ESNEXT if (ecma_prop_name_is_symbol (property_name_p)) { JERRY_ASSERT (!(arguments_p->header.u.cls.u1.arguments_flags & ECMA_ARGUMENTS_OBJECT_ITERATOR_INITIALIZED)); @@ -371,7 +350,6 @@ ecma_op_arguments_delete_built_in_property (ecma_object_t *object_p, /**< the ob arguments_p->header.u.cls.u1.arguments_flags |= ECMA_ARGUMENTS_OBJECT_ITERATOR_INITIALIZED; return; } -#endif /* JERRY_ESNEXT */ uint32_t index = ecma_string_get_array_index (property_name_p); @@ -436,24 +414,14 @@ ecma_op_arguments_object_list_lazy_property_names (ecma_object_t *obj_p, /**< ar ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLEE)); prop_counter_p->string_named_props++; } - -#if !JERRY_ESNEXT - if (!(flags & ECMA_ARGUMENTS_OBJECT_MAPPED)) - { - ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLER)); - prop_counter_p->string_named_props++; - } -#endif /* !JERRY_ESNEXT */ } -#if JERRY_ESNEXT if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS) && !(flags & ECMA_ARGUMENTS_OBJECT_ITERATOR_INITIALIZED)) { ecma_string_t *symbol_p = ecma_op_get_global_symbol (LIT_GLOBAL_SYMBOL_ITERATOR); ecma_collection_push_back (prop_names_p, ecma_make_symbol_value (symbol_p)); prop_counter_p->symbol_named_props++; } -#endif /* JERRY_ESNEXT */ } /* ecma_op_arguments_object_list_lazy_property_names */ /** diff --git a/jerry-core/ecma/operations/ecma-array-object.c b/jerry-core/ecma/operations/ecma-array-object.c index b150a980..5919ee6b 100644 --- a/jerry-core/ecma/operations/ecma-array-object.c +++ b/jerry-core/ecma/operations/ecma-array-object.c @@ -152,13 +152,11 @@ ecma_op_new_array_object (uint32_t length) /**< length of the new array */ ecma_object_t * ecma_op_new_array_object_from_length (ecma_length_t length) /**< length of the new array */ { -#if JERRY_ESNEXT if (length > UINT32_MAX) { ecma_raise_range_error (ECMA_ERR_INVALID_ARRAY_LENGTH); return NULL; } -#endif /* JERRY_ESNEXT */ return ecma_op_new_array_object ((uint32_t) length); } /* ecma_op_new_array_object_from_length */ @@ -663,7 +661,6 @@ ecma_fast_array_object_own_property_keys (ecma_object_t *object_p, /**< fast acc return ret_p; } /* ecma_fast_array_object_own_property_keys */ -#if JERRY_ESNEXT /** * Array object creation with custom prototype. * @@ -783,7 +780,6 @@ ecma_op_create_array_iterator (ecma_object_t *obj_p, /**< array object */ ECMA_OBJECT_CLASS_ARRAY_ITERATOR, kind); } /* ecma_op_create_array_iterator */ -#endif /* JERRY_ESNEXT */ /** * Low level delete of array items from new_length to old_length diff --git a/jerry-core/ecma/operations/ecma-array-object.h b/jerry-core/ecma/operations/ecma-array-object.h index d2d55f90..73d65805 100644 --- a/jerry-core/ecma/operations/ecma-array-object.h +++ b/jerry-core/ecma/operations/ecma-array-object.h @@ -88,11 +88,9 @@ ecma_collection_t *ecma_fast_array_object_own_property_keys (ecma_object_t *obje void ecma_fast_array_convert_to_normal (ecma_object_t *object_p); -#if JERRY_ESNEXT ecma_object_t *ecma_op_array_species_create (ecma_object_t *original_array_p, ecma_length_t length); ecma_value_t ecma_op_create_array_iterator (ecma_object_t *obj_p, ecma_iterator_kind_t kind); -#endif /* JERRY_ESNEXT */ ecma_value_t ecma_op_array_object_set_length (ecma_object_t *object_p, ecma_value_t new_value, uint16_t flags); diff --git a/jerry-core/ecma/operations/ecma-async-generator-object.c b/jerry-core/ecma/operations/ecma-async-generator-object.c index f40dc5b1..f73e4e18 100644 --- a/jerry-core/ecma/operations/ecma-async-generator-object.c +++ b/jerry-core/ecma/operations/ecma-async-generator-object.c @@ -32,8 +32,6 @@ #include "vm-stack.h" #include "vm.h" -#if JERRY_ESNEXT - /** \addtogroup ecma ECMA * @{ * @@ -126,6 +124,9 @@ ecma_async_yield_call (ecma_value_t function, /**< function (takes reference) */ /** * Perform an exception throw and call the approprite handler + * + * @return ecma value + * Returned value must be freed with ecma_free_value. */ static ecma_value_t ecma_async_yield_throw (vm_executable_object_t *async_generator_object_p, /**< async generator */ @@ -516,8 +517,6 @@ ecma_await_continue (vm_executable_object_t *executable_object_p, /**< executabl } } /* ecma_await_continue */ -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/operations/ecma-async-generator-object.h b/jerry-core/ecma/operations/ecma-async-generator-object.h index b5a94cf4..bcd58e0f 100644 --- a/jerry-core/ecma/operations/ecma-async-generator-object.h +++ b/jerry-core/ecma/operations/ecma-async-generator-object.h @@ -20,8 +20,6 @@ #include "vm-defines.h" -#if JERRY_ESNEXT - /** \addtogroup ecma ECMA * @{ * @@ -82,8 +80,6 @@ void ecma_async_generator_finalize (vm_executable_object_t *async_generator_obje ecma_value_t ecma_await_continue (vm_executable_object_t *async_generator_object_p, ecma_value_t value); -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/operations/ecma-big-uint.c b/jerry-core/ecma/operations/ecma-big-uint.c index 990318e9..3d058209 100644 --- a/jerry-core/ecma/operations/ecma-big-uint.c +++ b/jerry-core/ecma/operations/ecma-big-uint.c @@ -1473,8 +1473,6 @@ ecma_big_uint_shift_right (ecma_extended_primitive_t *left_value_p, /**< left Bi return ecma_big_uint_increase_result (result_value_p); } /* ecma_big_uint_shift_right */ -#if JERRY_ESNEXT - /** * Compute the left value raised to the power of right value * @@ -1545,8 +1543,6 @@ ecma_big_uint_pow (ecma_extended_primitive_t *left_value_p, /**< left BigUInt va return result_p; } /* ecma_big_uint_pow */ -#endif /* JERRY_ESNEXT */ - /** * Perform bitwise operations on two BigUInt numbers * diff --git a/jerry-core/ecma/operations/ecma-big-uint.h b/jerry-core/ecma/operations/ecma-big-uint.h index 7eec2dd5..727d780f 100644 --- a/jerry-core/ecma/operations/ecma-big-uint.h +++ b/jerry-core/ecma/operations/ecma-big-uint.h @@ -124,9 +124,7 @@ ecma_extended_primitive_t *ecma_big_uint_shift_left (ecma_extended_primitive_t * ecma_extended_primitive_t * ecma_big_uint_shift_right (ecma_extended_primitive_t *left_value_p, uint32_t right_value, bool increase_result); -#if JERRY_ESNEXT ecma_extended_primitive_t *ecma_big_uint_pow (ecma_extended_primitive_t *left_value_p, uint32_t right_value); -#endif /* JERRY_ESNEXT */ ecma_extended_primitive_t *ecma_big_uint_bitwise_op (uint32_t operation_and_options, ecma_extended_primitive_t *left_value_p, diff --git a/jerry-core/ecma/operations/ecma-bigint.c b/jerry-core/ecma/operations/ecma-bigint.c index 8ce37788..7a4464e0 100644 --- a/jerry-core/ecma/operations/ecma-bigint.c +++ b/jerry-core/ecma/operations/ecma-bigint.c @@ -1438,8 +1438,6 @@ ecma_bigint_shift (ecma_value_t left_value, /**< left BigInt value */ return ecma_make_extended_primitive_value (result_p, ECMA_TYPE_BIGINT); } /* ecma_bigint_shift */ -#if JERRY_ESNEXT - /** * Compute the left value raised to the power of right value * @@ -1528,8 +1526,6 @@ ecma_bigint_pow (ecma_value_t left_value, /**< left BigInt value */ return ecma_make_extended_primitive_value (result_p, ECMA_TYPE_BIGINT); } /* ecma_bigint_pow */ -#endif /* JERRY_ESNEXT */ - /** * Convert the result to an ecma value * diff --git a/jerry-core/ecma/operations/ecma-bigint.h b/jerry-core/ecma/operations/ecma-bigint.h index 33ad30d9..460ed769 100644 --- a/jerry-core/ecma/operations/ecma-bigint.h +++ b/jerry-core/ecma/operations/ecma-bigint.h @@ -70,9 +70,7 @@ ecma_value_t ecma_bigint_add_sub (ecma_value_t left_value, ecma_value_t right_va ecma_value_t ecma_bigint_mul (ecma_value_t left_value, ecma_value_t right_value); ecma_value_t ecma_bigint_div_mod (ecma_value_t left_value, ecma_value_t right_value, bool is_mod); ecma_value_t ecma_bigint_shift (ecma_value_t left_value, ecma_value_t right_value, bool is_left); -#if JERRY_ESNEXT ecma_value_t ecma_bigint_pow (ecma_value_t left_value, ecma_value_t right_value); -#endif /* JERRY_ESNEXT */ ecma_value_t ecma_bigint_and (ecma_value_t left_value, ecma_value_t right_value); ecma_value_t ecma_bigint_or (ecma_value_t left_value, ecma_value_t right_value); diff --git a/jerry-core/ecma/operations/ecma-boolean-object.c b/jerry-core/ecma/operations/ecma-boolean-object.c index e33299c6..956aa4a7 100644 --- a/jerry-core/ecma/operations/ecma-boolean-object.c +++ b/jerry-core/ecma/operations/ecma-boolean-object.c @@ -56,7 +56,6 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id); -#if JERRY_ESNEXT ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p); if (new_target) { @@ -67,7 +66,7 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo return ECMA_VALUE_ERROR; } } -#endif /* JERRY_ESNEXT */ + ecma_object_t *object_p = ecma_create_object (prototype_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS); @@ -75,12 +74,10 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_BOOLEAN; ext_object_p->u.cls.u3.value = ecma_make_boolean_value (boolean_value); -#if JERRY_ESNEXT if (new_target) { ecma_deref_object (prototype_obj_p); } -#endif /* JERRY_ESNEXT */ return ecma_make_object_value (object_p); } /* ecma_op_create_boolean_object */ diff --git a/jerry-core/ecma/operations/ecma-comparison.c b/jerry-core/ecma/operations/ecma-comparison.c index 68135fa2..5a32a2c6 100644 --- a/jerry-core/ecma/operations/ecma-comparison.c +++ b/jerry-core/ecma/operations/ecma-comparison.c @@ -196,7 +196,6 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */ return ecma_make_boolean_value (is_equal); } -#if JERRY_ESNEXT if (JERRY_UNLIKELY (ecma_is_value_symbol (x))) { if (!ecma_is_value_object (y)) @@ -209,14 +208,10 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */ y ^= x; x ^= y; } -#endif /* JERRY_ESNEXT */ JERRY_ASSERT (ecma_is_value_object (x)); - if (ecma_is_value_string (y) -#if JERRY_ESNEXT - || ecma_is_value_symbol (y) -#endif /* JERRY_ESNEXT */ + if (ecma_is_value_string (y) || ecma_is_value_symbol (y) #if JERRY_BUILTIN_BIGINT || ecma_is_value_bigint (y) #endif /* JERRY_BUILTIN_BIGINT */ @@ -254,10 +249,7 @@ bool ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */ ecma_value_t y) /**< second operand */ { - if (ecma_is_value_direct (x) || ecma_is_value_direct (y) -#if JERRY_ESNEXT - || ecma_is_value_symbol (x) || ecma_is_value_symbol (y) -#endif /* JERRY_ESNEXT */ + if (ecma_is_value_direct (x) || ecma_is_value_direct (y) || ecma_is_value_symbol (x) || ecma_is_value_symbol (y) || ecma_is_value_object (x) || ecma_is_value_object (y)) { JERRY_ASSERT (!ecma_is_value_direct (x) || ecma_is_value_undefined (x) || ecma_is_value_null (x) diff --git a/jerry-core/ecma/operations/ecma-container-object.c b/jerry-core/ecma/operations/ecma-container-object.c index f975c39a..c9bc10cb 100644 --- a/jerry-core/ecma/operations/ecma-container-object.c +++ b/jerry-core/ecma/operations/ecma-container-object.c @@ -383,7 +383,6 @@ ecma_op_container_create (const ecma_value_t *arguments_list_p, /**< arguments l ecma_value_t set_value = ecma_make_object_value (object_p); ecma_value_t result = set_value; -#if JERRY_ESNEXT if (arguments_list_len == 0) { return result; @@ -525,7 +524,6 @@ cleanup_adder: ecma_deref_object (adder_func_p); cleanup_object: ecma_deref_object (object_p); -#endif /* JERRY_ESNEXT */ return result; } /* ecma_op_container_create */ @@ -875,8 +873,6 @@ ecma_op_container_remove_weak_entry (ecma_object_t *object_p, /**< internal cont ecma_op_internal_buffer_delete (container_p, (ecma_container_pair_t *) entry_p, map_object_p->u.cls.u2.container_id); } /* ecma_op_container_remove_weak_entry */ -#if JERRY_ESNEXT - /** * The Create{Set, Map}Iterator Abstract operation * @@ -1137,8 +1133,6 @@ ecma_builtin_container_dispatch_routine (uint16_t builtin_routine_id, /**< built } } /* ecma_builtin_container_dispatch_routine */ -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/operations/ecma-conversion.c b/jerry-core/ecma/operations/ecma-conversion.c index 9a71b2ff..cf0c9fde 100644 --- a/jerry-core/ecma/operations/ecma-conversion.c +++ b/jerry-core/ecma/operations/ecma-conversion.c @@ -337,12 +337,10 @@ ecma_op_to_numeric (ecma_value_t value, /**< ecma value */ return ECMA_VALUE_EMPTY; } -#if JERRY_ESNEXT if (ecma_is_value_symbol (value)) { return ecma_raise_type_error (ECMA_ERR_CONVERT_SYMBOL_TO_NUMBER); } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT if (ecma_is_value_bigint (value)) @@ -434,13 +432,11 @@ ecma_op_to_string (ecma_value_t value) /**< ecma value */ return ecma_get_magic_string (LIT_MAGIC_STRING_FALSE); } -#if JERRY_ESNEXT if (ecma_is_value_symbol (value)) { ecma_raise_type_error (ECMA_ERR_CONVERT_SYMBOL_TO_STRING); return NULL; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT if (ecma_is_value_bigint (value)) @@ -489,7 +485,6 @@ ecma_op_to_property_key (ecma_value_t value) /**< ecma value */ return key_p; } -#if JERRY_ESNEXT ecma_value_t key = ecma_op_to_primitive (value, ECMA_PREFERRED_TYPE_STRING); if (ECMA_IS_VALUE_ERROR (key)) @@ -507,11 +502,6 @@ ecma_op_to_property_key (ecma_value_t value) /**< ecma value */ ecma_free_value (key); return result; -#else /* !JERRY_ESNEXT */ - ecma_check_value_type_is_spec_defined (value); - - return ecma_op_to_string (value); -#endif /* JERRY_ESNEXT */ } /* ecma_op_to_property_key */ /** @@ -548,13 +538,11 @@ ecma_op_to_object (ecma_value_t value) /**< ecma value */ { return ecma_copy_value (value); } -#if JERRY_ESNEXT else if (ecma_is_value_symbol (value)) { proto_id = ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE; class_type = ECMA_OBJECT_CLASS_SYMBOL; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT else if (ecma_is_value_bigint (value)) { @@ -628,40 +616,33 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE), &prop_desc); JERRY_ASSERT (ecma_is_value_true (completion)); } - else + else if (src_prop_desc_p->flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED)) { -#if !JERRY_ESNEXT - JERRY_ASSERT (src_prop_desc_p->flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED)); -#else /* JERRY_ESNEXT */ - if (src_prop_desc_p->flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED)) -#endif /* JERRY_ESNEXT */ + /* a. */ + if (src_prop_desc_p->get_p == NULL) + { + prop_desc.value = ECMA_VALUE_UNDEFINED; + } + else { - /* a. */ - if (src_prop_desc_p->get_p == NULL) - { - prop_desc.value = ECMA_VALUE_UNDEFINED; - } - else - { - prop_desc.value = ecma_make_object_value (src_prop_desc_p->get_p); - } - - completion = ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_GET), &prop_desc); - JERRY_ASSERT (ecma_is_value_true (completion)); - - /* b. */ - if (src_prop_desc_p->set_p == NULL) - { - prop_desc.value = ECMA_VALUE_UNDEFINED; - } - else - { - prop_desc.value = ecma_make_object_value (src_prop_desc_p->set_p); - } - - completion = ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_SET), &prop_desc); - JERRY_ASSERT (ecma_is_value_true (completion)); + prop_desc.value = ecma_make_object_value (src_prop_desc_p->get_p); } + + completion = ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_GET), &prop_desc); + JERRY_ASSERT (ecma_is_value_true (completion)); + + /* b. */ + if (src_prop_desc_p->set_p == NULL) + { + prop_desc.value = ECMA_VALUE_UNDEFINED; + } + else + { + prop_desc.value = ecma_make_object_value (src_prop_desc_p->set_p); + } + + completion = ecma_op_object_define_own_property (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_SET), &prop_desc); + JERRY_ASSERT (ecma_is_value_true (completion)); } prop_desc.value = ecma_make_boolean_value (src_prop_desc_p->flags & JERRY_PROP_IS_ENUMERABLE); @@ -959,7 +940,6 @@ ecma_op_to_length (ecma_value_t value, /**< ecma value */ return value; } -#if JERRY_ESNEXT /* 2 */ ecma_number_t num; ecma_value_t length_num = ecma_op_to_integer (value, &num); @@ -987,23 +967,8 @@ ecma_op_to_length (ecma_value_t value, /**< ecma value */ /* 6 */ *length = (ecma_length_t) num; return ECMA_VALUE_EMPTY; -#else /* !JERRY_ESNEXT */ - /* In the case of ES5, ToLength(ES6) operation is the same as ToUint32(ES5) */ - ecma_number_t num; - ecma_value_t to_number = ecma_op_to_number (value, &num); - - /* 2 */ - if (ECMA_IS_VALUE_ERROR (to_number)) - { - return to_number; - } - - *length = ecma_number_to_uint32 (num); - return ECMA_VALUE_EMPTY; -#endif /* JERRY_ESNEXT */ } /* ecma_op_to_length */ -#if JERRY_ESNEXT /** * ToIndex operation. * @@ -1104,7 +1069,6 @@ ecma_op_create_list_from_array_like (ecma_value_t arr, /**< array value */ /* 9. */ return list_ptr; } /* ecma_op_create_list_from_array_like */ -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/operations/ecma-conversion.h b/jerry-core/ecma/operations/ecma-conversion.h index 559b8552..a19ade54 100644 --- a/jerry-core/ecma/operations/ecma-conversion.h +++ b/jerry-core/ecma/operations/ecma-conversion.h @@ -62,10 +62,8 @@ ecma_value_t ecma_op_to_object (ecma_value_t value); bool ecma_op_is_integer (ecma_number_t value); ecma_value_t ecma_op_to_integer (ecma_value_t value, ecma_number_t *number_p); ecma_value_t ecma_op_to_length (ecma_value_t value, ecma_length_t *length); -#if JERRY_ESNEXT ecma_value_t ecma_op_to_index (ecma_value_t value, ecma_number_t *index); ecma_collection_t *ecma_op_create_list_from_array_like (ecma_value_t arr, bool prop_names_only); -#endif /* JERRY_ESNEXT */ ecma_object_t *ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_desc_p); ecma_value_t ecma_op_to_property_descriptor (ecma_value_t obj_value, ecma_property_descriptor_t *out_prop_desc_p); diff --git a/jerry-core/ecma/operations/ecma-eval.c b/jerry-core/ecma/operations/ecma-eval.c index e4a2d734..ac8e2c40 100644 --- a/jerry-core/ecma/operations/ecma-eval.c +++ b/jerry-core/ecma/operations/ecma-eval.c @@ -81,9 +81,7 @@ ecma_op_eval_chars_buffer (void *source_p, /**< source code */ parse_opts |= ECMA_PARSE_EVAL; -#if JERRY_ESNEXT ECMA_CLEAR_LOCAL_PARSE_OPTS (); -#endif /* JERRY_ESNEXT */ ecma_compiled_code_t *bytecode_p = parser_parse_script (source_p, parse_opts, NULL); @@ -93,12 +91,6 @@ ecma_op_eval_chars_buffer (void *source_p, /**< source code */ } return vm_run_eval (bytecode_p, parse_opts); -#else /* !JERRY_PARSER */ - JERRY_UNUSED (code_p); - JERRY_UNUSED (code_buffer_size); - JERRY_UNUSED (parse_opts); - - return ecma_raise_syntax_error (ECMA_ERR_PARSER_NOT_SUPPORTED); #endif /* JERRY_PARSER */ } /* ecma_op_eval_chars_buffer */ diff --git a/jerry-core/ecma/operations/ecma-exceptions.c b/jerry-core/ecma/operations/ecma-exceptions.c index 9232a680..675aaf92 100644 --- a/jerry-core/ecma/operations/ecma-exceptions.c +++ b/jerry-core/ecma/operations/ecma-exceptions.c @@ -87,13 +87,12 @@ ecma_new_standard_error (jerry_error_t error_type, /**< native error type */ break; } -#if JERRY_ESNEXT case JERRY_ERROR_AGGREGATE: { prototype_id = ECMA_BUILTIN_ID_AGGREGATE_ERROR_PROTOTYPE; break; } -#endif /* JERRY_ESNEXT */ + case JERRY_ERROR_URI: { prototype_id = ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE; @@ -169,7 +168,6 @@ ecma_new_standard_error (jerry_error_t error_type, /**< native error type */ return error_object_p; } /* ecma_new_standard_error */ -#if JERRY_ESNEXT /** * aggregate-error object constructor. * @@ -273,8 +271,6 @@ ecma_new_aggregate_error (ecma_value_t error_list_val, /**< errors list */ return ecma_make_object_value (new_error_object_p); } /* ecma_new_aggregate_error */ -#endif /* JERRY_ESNEXT */ - /** * Return the error type for an Error object. * @@ -364,13 +360,11 @@ ecma_raise_standard_error_with_format (jerry_error_t error_type, /**< error type lit_magic_string_id_t class_name = ecma_object_get_class_name (arg_object_p); arg_string_p = ecma_get_magic_string (class_name); } -#if JERRY_ESNEXT else if (ecma_is_value_symbol (arg_val)) { ecma_value_t symbol_desc_value = ecma_get_symbol_descriptive_string (arg_val); arg_string_p = ecma_get_string_from_value (symbol_desc_value); } -#endif /* JERRY_ESNEXT */ else { arg_string_p = ecma_op_to_string (arg_val); @@ -504,8 +498,6 @@ ecma_raise_maximum_callstack_error (void) } /* ecma_raise_maximum_callstack_error */ #endif /* (JERRY_STACK_LIMIT != 0) */ -#if JERRY_ESNEXT - /** * Raise a AggregateError with the given errors and message. * @@ -522,8 +514,6 @@ ecma_raise_aggregate_error (ecma_value_t error_list_val, /**< errors list */ return ECMA_VALUE_ERROR; } /* ecma_raise_aggregate_error */ -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/operations/ecma-exceptions.h b/jerry-core/ecma/operations/ecma-exceptions.h index d4e6477d..c367a6bf 100644 --- a/jerry-core/ecma/operations/ecma-exceptions.h +++ b/jerry-core/ecma/operations/ecma-exceptions.h @@ -42,10 +42,8 @@ ecma_value_t ecma_raise_uri_error (ecma_error_msg_t msg); #if (JERRY_STACK_LIMIT != 0) ecma_value_t ecma_raise_maximum_callstack_error (void); #endif /* (JERRY_STACK_LIMIT != 0) */ -#if JERRY_ESNEXT ecma_value_t ecma_new_aggregate_error (ecma_value_t error_list_val, ecma_value_t message_val); ecma_value_t ecma_raise_aggregate_error (ecma_value_t error_list_val, ecma_value_t message_val); -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/operations/ecma-function-object.c b/jerry-core/ecma/operations/ecma-function-object.c index 243e31ad..1e24384c 100644 --- a/jerry-core/ecma/operations/ecma-function-object.c +++ b/jerry-core/ecma/operations/ecma-function-object.c @@ -41,7 +41,6 @@ * @{ */ -#if JERRY_ESNEXT /** * SetFunctionName operation * @@ -91,7 +90,6 @@ ecma_op_function_form_name (ecma_string_t *prop_name_p, /**< property name */ return ecma_make_string_value (prop_name_p); } /* ecma_op_function_form_name */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_PROXY /** @@ -180,7 +178,6 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */ if (JERRY_LIKELY (type == ECMA_OBJECT_TYPE_FUNCTION)) { -#if JERRY_ESNEXT const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) obj_p); if (!CBC_FUNCTION_IS_CONSTRUCTABLE (byte_code_p->status_flags)) @@ -226,7 +223,6 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */ return ECMA_ERR_EMPTY; #endif /* JERRY_ERROR_MESSAGES */ } -#endif /* JERRY_NEXT */ return ECMA_IS_VALID_CONSTRUCTOR; } @@ -253,9 +249,7 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */ return ECMA_ERR_BULTIN_ROUTINES_HAVE_NO_CONSTRUCTOR; } -#if JERRY_ESNEXT JERRY_ASSERT (((ecma_extended_object_t *) obj_p)->u.built_in.id != ECMA_BUILTIN_ID_HANDLER); -#endif /* !JERRY_ESNEXT */ } return ECMA_IS_VALID_CONSTRUCTOR; @@ -487,11 +481,9 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu return ECMA_VALUE_ERROR; } -#if JERRY_ESNEXT ecma_value_t *func_name_p; func_name_p = ecma_compiled_code_resolve_function_name ((const ecma_compiled_code_t *) bytecode_p); *func_name_p = ecma_make_magic_string_value (LIT_MAGIC_STRING_ANONYMOUS); -#endif /* JERRY_ESNEXT */ ecma_object_t *global_object_p = ecma_builtin_get_global (); @@ -501,8 +493,6 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu ecma_object_t *global_env_p = ecma_get_global_environment (global_object_p); ecma_builtin_id_t fallback_proto = ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE; - -#if JERRY_ESNEXT ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target_p); ecma_builtin_id_t fallback_ctor = ECMA_BUILTIN_ID_FUNCTION; @@ -535,14 +525,11 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu ecma_bytecode_deref (bytecode_p); return ECMA_VALUE_ERROR; } -#endif /* JERRY_ESNEXT */ ecma_object_t *func_obj_p = ecma_op_create_function_object (global_env_p, bytecode_p, fallback_proto); -#if JERRY_ESNEXT ECMA_SET_NON_NULL_POINTER (func_obj_p->u2.prototype_cp, proto); ecma_deref_object (proto); -#endif /* JERRY_ESNEXT */ ecma_bytecode_deref (bytecode_p); return ecma_make_object_value (func_obj_p); @@ -562,8 +549,6 @@ ecma_op_create_simple_function_object (ecma_object_t *scope_p, /**< function's s return ecma_op_create_function_object (scope_p, bytecode_data_p, ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE); } /* ecma_op_create_simple_function_object */ -#if JERRY_ESNEXT - /** * Create a function object with the appropriate prototype. * @@ -666,8 +651,6 @@ ecma_op_create_arrow_function_object (ecma_object_t *scope_p, /**< function's sc return func_p; } /* ecma_op_create_arrow_function_object */ -#endif /* JERRY_ESNEXT */ - /** * External function object creation operation. * @@ -700,8 +683,6 @@ ecma_op_create_external_function_object (ecma_native_handler_t handler_cb) /**< return function_obj_p; } /* ecma_op_create_external_function_object */ -#if JERRY_ESNEXT - /** * Create built-in native handler object. * @@ -727,8 +708,6 @@ ecma_op_create_native_handler (ecma_native_handler_id_t id, /**< handler id */ return function_obj_p; } /* ecma_op_create_native_handler */ -#endif /* JERRY_ESNEXT */ - /** * Get compiled code of a function object. * @@ -809,7 +788,6 @@ ecma_op_function_get_function_realm (ecma_object_t *func_obj_p) /**< function ob return ECMA_GET_INTERNAL_VALUE_POINTER (ecma_global_object_t, native_function_p->realm_value); } -#if JERRY_ESNEXT if (type == ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION) { ecma_value_t script_value = ((ecma_extended_object_t *) func_obj_p)->u.constructor_function.script_value; @@ -817,7 +795,6 @@ ecma_op_function_get_function_realm (ecma_object_t *func_obj_p) /**< function ob return (ecma_global_object_t *) script_p->realm_p; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_PROXY if (ECMA_OBJECT_IS_PROXY (func_obj_p)) @@ -935,8 +912,6 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object * return result; } /* ecma_op_function_has_instance */ -#if JERRY_ESNEXT - /** * GetSuperConstructor operation for class methods * @@ -965,7 +940,6 @@ ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p) /**< function return ecma_make_object_value (super_ctor_p); } /* ecma_op_function_get_super_constructor */ -#endif /* JERRY_ESNEXT */ /** * Ordinary internal method: GetPrototypeFromConstructor (constructor, intrinsicDefaultProto) @@ -1024,7 +998,6 @@ ecma_op_get_prototype_from_constructor (ecma_object_t *ctor_obj_p, /**< construc return proto_obj_p; } /* ecma_op_get_prototype_from_constructor */ -#if JERRY_ESNEXT /** * Perform a JavaScript class function object method call. * @@ -1092,8 +1065,6 @@ exit: return ret_value; } /* ecma_op_function_call_constructor */ -#endif /* JERRY_ESNEXT */ - /** * Perform a JavaScript function object method call. * @@ -1140,7 +1111,6 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */ /* 1. */ switch (CBC_FUNCTION_GET_TYPE (status_flags)) { -#if JERRY_ESNEXT case CBC_FUNCTION_CONSTRUCTOR: { return ecma_op_function_call_constructor (&shared_args, scope_p, this_binding); @@ -1168,13 +1138,9 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */ } break; } - -#endif /* JERRY_ESNEXT */ default: { -#if JERRY_ESNEXT shared_args.header.status_flags |= VM_FRAME_CTX_SHARED_NON_ARROW_FUNC; -#endif /* JERRY_ESNEXT */ if (status_flags & CBC_CODE_FLAGS_STRICT_MODE) { @@ -1281,12 +1247,8 @@ ecma_op_function_call_native (ecma_object_t *func_obj_p, /**< Function object */ call_info.function = ecma_make_object_value (func_obj_p); call_info.this_value = this_arg_value; -#if JERRY_ESNEXT ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target_p); call_info.new_target = (new_target_p == NULL) ? ECMA_VALUE_UNDEFINED : ecma_make_object_value (new_target_p); -#else /* JERRY_ESNEXT */ - call_info.new_target = ECMA_VALUE_UNDEFINED; -#endif /* JERRY_ESNEXT */ JERRY_ASSERT (native_function_p->native_handler_cb != NULL); ecma_value_t ret_value = native_function_p->native_handler_cb (&call_info, arguments_list_p, arguments_list_len); @@ -1428,14 +1390,12 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */ ECMA_CHECK_STACK_USAGE (); -#if JERRY_ESNEXT ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p); if (JERRY_UNLIKELY (!(JERRY_CONTEXT (status_flags) & ECMA_STATUS_DIRECT_EVAL))) { JERRY_CONTEXT (current_new_target_p) = NULL; } -#endif /* JERRY_ESNEXT */ ecma_value_t result; @@ -1458,13 +1418,11 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */ break; } #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION: { result = ecma_raise_type_error (ECMA_ERR_CLASS_CONSTRUCTOR_NEW); break; } -#endif /* JERRY_ESNEXT */ case ECMA_OBJECT_TYPE_NATIVE_FUNCTION: { result = ecma_op_function_call_native (func_obj_p, this_arg_value, arguments_list_p, arguments_list_len); @@ -1482,9 +1440,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */ } } -#if JERRY_ESNEXT JERRY_CONTEXT (current_new_target_p) = old_new_target_p; -#endif /* JERRY_ESNEXT */ return result; } /* ecma_op_function_call */ @@ -1506,13 +1462,11 @@ ecma_op_function_construct_simple (ecma_object_t *func_obj_p, /**< Function obje ecma_object_t *new_this_obj_p = NULL; ecma_value_t this_arg; -#if JERRY_ESNEXT ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) func_obj_p; /* 5. */ if (!ECMA_GET_THIRD_BIT_FROM_POINTER_TAG (ext_func_obj_p->u.function.scope_cp)) { -#endif /* JERRY_ESNEXT */ /* 5.a */ ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (new_target_p, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE); @@ -1525,7 +1479,6 @@ ecma_op_function_construct_simple (ecma_object_t *func_obj_p, /**< Function obje new_this_obj_p = ecma_create_object (proto_p, 0, ECMA_OBJECT_TYPE_GENERAL); ecma_deref_object (proto_p); this_arg = ecma_make_object_value (new_this_obj_p); -#if JERRY_ESNEXT } else { @@ -1535,25 +1488,19 @@ ecma_op_function_construct_simple (ecma_object_t *func_obj_p, /**< Function obje /* 6. */ ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p); JERRY_CONTEXT (current_new_target_p) = new_target_p; -#endif /* JERRY_ESNEXT */ ecma_value_t ret_value = ecma_op_function_call_simple (func_obj_p, this_arg, arguments_list_p, arguments_list_len); -#if JERRY_ESNEXT JERRY_CONTEXT (current_new_target_p) = old_new_target_p; -#endif /* JERRY_ESNEXT */ /* 13.a */ if (ECMA_IS_VALUE_ERROR (ret_value) || ecma_is_value_object (ret_value)) { -#if JERRY_ESNEXT if (new_this_obj_p != NULL) { ecma_deref_object (new_this_obj_p); } -#else /* !JERRY_ESNEXT */ - ecma_deref_object (new_this_obj_p); -#endif /* JERRY_ESNEXT */ + return ret_value; } @@ -1584,16 +1531,12 @@ ecma_op_function_construct_built_in (ecma_object_t *func_obj_p, /**< Function ob JERRY_CONTEXT (global_object_p) = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_global_object_t, realm_value); #endif /* JERRY_BUILTIN_REALMS */ -#if JERRY_ESNEXT ecma_object_t *old_new_target = JERRY_CONTEXT (current_new_target_p); JERRY_CONTEXT (current_new_target_p) = new_target_p; -#endif /* JERRY_ESNEXT */ ecma_value_t ret_value = ecma_builtin_dispatch_construct (func_obj_p, arguments_list_p, arguments_list_len); -#if JERRY_ESNEXT JERRY_CONTEXT (current_new_target_p) = old_new_target; -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_REALMS JERRY_CONTEXT (global_object_p) = saved_global_object_p; @@ -1637,8 +1580,6 @@ ecma_op_function_construct_bound (ecma_object_t *func_obj_p, /**< Function objec return ret_value; } /* ecma_op_function_construct_bound */ -#if JERRY_ESNEXT - /** * [[Construct]] internal method for class implicit constructor objects * @@ -1704,8 +1645,6 @@ ecma_op_function_construct_constructor (ecma_object_t *func_obj_p, /**< Function return result; } /* ecma_op_function_construct_constructor */ -#endif /* JERRY_ESNEXT */ - /** * [[Construct]] internal method for external function objects * @@ -1731,16 +1670,12 @@ ecma_op_function_construct_native (ecma_object_t *func_obj_p, /**< Function obje ecma_value_t this_arg = ecma_make_object_value (new_this_obj_p); ecma_deref_object (proto_p); -#if JERRY_ESNEXT ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p); JERRY_CONTEXT (current_new_target_p) = new_target_p; -#endif /* JERRY_ESNEXT */ ecma_value_t ret_value = ecma_op_function_call_native (func_obj_p, this_arg, arguments_list_p, arguments_list_len); -#if JERRY_ESNEXT JERRY_CONTEXT (current_new_target_p) = old_new_target_p; -#endif /* JERRY_ESNEXT */ if (ECMA_IS_VALUE_ERROR (ret_value) || ecma_is_value_object (ret_value)) { @@ -1787,12 +1722,10 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */ return ecma_proxy_object_construct (func_obj_p, new_target_p, arguments_list_p, arguments_list_len); } #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION: { return ecma_op_function_construct_constructor (func_obj_p, new_target_p, arguments_list_p, arguments_list_len); } -#endif /* JERRY_ESNEXT */ case ECMA_OBJECT_TYPE_BOUND_FUNCTION: { return ecma_op_function_construct_bound (func_obj_p, new_target_p, arguments_list_p, arguments_list_len); @@ -1844,7 +1777,6 @@ ecma_op_lazy_instantiate_prototype_object (ecma_object_t *object_p) /**< the fun ecma_object_t *proto_object_p = NULL; bool init_constructor = true; -#if JERRY_ESNEXT if (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION) { const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p); @@ -1882,11 +1814,8 @@ ecma_op_lazy_instantiate_prototype_object (ecma_object_t *object_p) /**< the fun init_constructor = false; } } -#endif /* JERRY_ESNEXT */ -#if JERRY_ESNEXT if (proto_object_p == NULL) -#endif /* JERRY_ESNEXT */ { ecma_object_t *prototype_p; @@ -1943,7 +1872,6 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**< { JERRY_ASSERT (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION); -#if JERRY_ESNEXT if (ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_LENGTH)) { ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p; @@ -2011,7 +1939,6 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**< value_p->value = ecma_copy_value (value); return value_prop_p; } -#endif /* JERRY_ESNEXT */ if (ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_PROTOTYPE) && ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION) @@ -2026,7 +1953,6 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**< const ecma_compiled_code_t *bytecode_data_p; bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p); -#if JERRY_ESNEXT if (!(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) && CBC_FUNCTION_GET_TYPE (bytecode_data_p->status_flags) == CBC_FUNCTION_NORMAL) { @@ -2037,22 +1963,6 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**< value_p->value = is_arguments ? ECMA_VALUE_NULL : ECMA_VALUE_UNDEFINED; return value_prop_p; } -#else /* !JERRY_ESNEXT */ - if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) - { - ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER); - - ecma_property_t *caller_prop_p; - /* The property_name_p argument contains the name. */ - ecma_create_named_accessor_property (object_p, - property_name_p, - thrower_p, - thrower_p, - ECMA_PROPERTY_BUILT_IN_FIXED, - &caller_prop_p); - return caller_prop_p; - } -#endif /* JERRY_ESNEXT */ } return NULL; @@ -2109,7 +2019,6 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p args_length = ecma_get_integer_from_value (args_len_or_this); } -#if JERRY_ESNEXT if (ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (bound_func_p->header.u.bound_function.target_function)) { return NULL; @@ -2117,24 +2026,6 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p length_attributes = ECMA_PROPERTY_BUILT_IN_CONFIGURABLE; length = ecma_get_number_from_value (bound_func_p->target_length) - (args_length - 1); -#else /* !JERRY_ESNEXT */ - length_attributes = ECMA_PROPERTY_BUILT_IN_FIXED; - - ecma_object_t *target_func_p; - target_func_p = - ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t, bound_func_p->header.u.bound_function.target_function); - - if (ecma_object_get_class_name (target_func_p) == LIT_MAGIC_STRING_FUNCTION_UL) - { - /* The property_name_p argument contains the 'length' string. */ - ecma_value_t get_len_value = ecma_op_object_get (target_func_p, property_name_p); - - JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (get_len_value)); - JERRY_ASSERT (ecma_is_value_integer_number (get_len_value)); - - length = (ecma_number_t) (ecma_get_integer_from_value (get_len_value) - (args_length - 1)); - } -#endif /* JERRY_ESNEXT */ if (length < 0) { @@ -2149,29 +2040,9 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p return len_prop_p; } -#if !JERRY_ESNEXT - if (ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_CALLER) - || ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_ARGUMENTS)) - { - ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER); - - ecma_property_t *caller_prop_p; - /* The string_p argument contans the name. */ - ecma_create_named_accessor_property (object_p, - property_name_p, - thrower_p, - thrower_p, - ECMA_PROPERTY_BUILT_IN_FIXED, - &caller_prop_p); - return caller_prop_p; - } -#endif /* !JERRY_ESNEXT */ - return NULL; } /* ecma_op_bound_function_try_to_lazy_instantiate_property */ -#if JERRY_ESNEXT - /** * Delete configurable properties of functions. */ @@ -2211,8 +2082,6 @@ ecma_op_bound_function_delete_built_in_property (ecma_object_t *object_p, /**< o ECMA_SET_FIRST_BIT_TO_POINTER_TAG (bound_func_p->header.u.bound_function.target_function); } /* ecma_op_bound_function_delete_built_in_property */ -#endif /* JERRY_ESNEXT */ - /** * List names of a Function object's lazy instantiated properties, * adding them to corresponding string collections @@ -2234,7 +2103,6 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio const ecma_compiled_code_t *bytecode_data_p; bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p); -#if JERRY_ESNEXT ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p; if (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (ext_func_p->u.function.scope_cp)) @@ -2251,25 +2119,14 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_NAME)); prop_counter_p->string_named_props++; } -#else /* !JERRY_ESNEXT */ - /* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */ - ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH)); - prop_counter_p->string_named_props++; -#endif /* JERRY_ESNEXT */ -#if JERRY_ESNEXT if (!CBC_FUNCTION_HAS_PROTOTYPE (bytecode_data_p->status_flags) || (CBC_FUNCTION_GET_TYPE (bytecode_data_p->status_flags) == CBC_FUNCTION_CONSTRUCTOR)) { return; } - bool append_caller_and_arguments = !(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE); -#else /* !JERRY_ESNEXT */ - bool append_caller_and_arguments = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE); -#endif /* JERRY_ESNEXT */ - - if (append_caller_and_arguments) + if (!(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)) { /* 'arguments' property is non-enumerable (ECMA-262 v5, 13.2.5) */ ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_ARGUMENTS)); @@ -2329,7 +2186,6 @@ ecma_op_bound_function_list_lazy_property_names (ecma_object_t *object_p, /**< b return; } -#if JERRY_ESNEXT /* Unintialized 'length' property is non-enumerable (ECMA-262 v6, 19.2.4.1) */ ecma_bound_function_t *bound_func_p = (ecma_bound_function_t *) object_p; if (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (bound_func_p->header.u.bound_function.target_function)) @@ -2337,12 +2193,6 @@ ecma_op_bound_function_list_lazy_property_names (ecma_object_t *object_p, /**< b ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH)); prop_counter_p->string_named_props++; } -#else /* !JERRY_ESNEXT */ - JERRY_UNUSED (object_p); - /* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */ - ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH)); - prop_counter_p->string_named_props++; -#endif /* JERRY_ESNEXT */ /* 'caller' property is non-enumerable (ECMA-262 v5, 13.2.5) */ ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLER)); diff --git a/jerry-core/ecma/operations/ecma-function-object.h b/jerry-core/ecma/operations/ecma-function-object.h index 3f9c602d..08300f57 100644 --- a/jerry-core/ecma/operations/ecma-function-object.h +++ b/jerry-core/ecma/operations/ecma-function-object.h @@ -29,9 +29,7 @@ * @{ */ -#if JERRY_ESNEXT ecma_value_t ecma_op_function_form_name (ecma_string_t *prop_name_p, char *prefix_p, lit_utf8_size_t prefix_size); -#endif /* JERRY_ESNEXT */ bool ecma_op_is_callable (ecma_value_t value); #if JERRY_BUILTIN_PROXY @@ -67,7 +65,6 @@ ecma_value_t ecma_op_create_dynamic_function (const ecma_value_t *arguments_list uint32_t arguments_list_len, ecma_parse_opts_t opts); -#if JERRY_ESNEXT ecma_value_t ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p); ecma_object_t *ecma_op_create_any_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p); @@ -78,8 +75,6 @@ ecma_object_t *ecma_op_create_arrow_function_object (ecma_object_t *scope_p, ecma_object_t *ecma_op_create_native_handler (ecma_native_handler_id_t id, size_t object_size); -#endif /* JERRY_ESNEXT */ - ecma_object_t *ecma_op_get_prototype_from_constructor (ecma_object_t *ctor_obj_p, ecma_builtin_id_t default_proto_id); ecma_value_t ecma_op_function_has_instance (ecma_object_t *func_obj_p, ecma_value_t value); @@ -108,11 +103,9 @@ ecma_property_t *ecma_op_external_function_try_to_lazy_instantiate_property (ecm ecma_property_t *ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); -#if JERRY_ESNEXT void ecma_op_function_delete_built_in_property (ecma_object_t *object_p, ecma_string_t *property_name_p); void ecma_op_bound_function_delete_built_in_property (ecma_object_t *object_p, ecma_string_t *property_name_p); -#endif /* JERRY_ESNEXT */ void ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, ecma_collection_t *prop_names_p, diff --git a/jerry-core/ecma/operations/ecma-get-put-value.c b/jerry-core/ecma/operations/ecma-get-put-value.c index 41bdf37d..39d4d373 100644 --- a/jerry-core/ecma/operations/ecma-get-put-value.c +++ b/jerry-core/ecma/operations/ecma-get-put-value.c @@ -62,18 +62,15 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme *ref_base_lex_env_p = lex_env_p; ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p); -#if JERRY_ESNEXT if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED)) { return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED); } -#endif /* JERRY_ESNEXT */ return ecma_fast_copy_value (property_value_p->value); } break; } -#if JERRY_ESNEXT case ECMA_LEXICAL_ENVIRONMENT_CLASS: { #if JERRY_MODULE_SYSTEM @@ -102,7 +99,6 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme #endif /* JERRY_MODULE_SYSTEM */ break; } -#endif /* JERRY_ESNEXT */ default: { JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND); @@ -188,12 +184,10 @@ ecma_op_get_value_object_base (ecma_value_t base_value, /**< base value */ id = ECMA_BUILTIN_ID_NUMBER_PROTOTYPE; #endif /* JERRY_BUILTIN_NUMBER */ } -#if JERRY_ESNEXT else if (ecma_is_value_symbol (base_value)) { id = ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_BIGINT else if (ecma_is_value_bigint (base_value)) { @@ -234,7 +228,6 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme { switch (ecma_get_lex_env_type (lex_env_p)) { -#if JERRY_ESNEXT case ECMA_LEXICAL_ENVIRONMENT_CLASS: { if (!ECMA_LEX_ENV_CLASS_IS_MODULE (lex_env_p)) @@ -243,14 +236,12 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme } /* FALLTHRU */ } -#endif /* JERRY_ESNEXT */ case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE: { ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p); if (property_p != NULL) { -#if JERRY_ESNEXT ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p); JERRY_ASSERT (!(*property_p & ECMA_PROPERTY_FLAG_WRITABLE) || (*property_p & ECMA_PROPERTY_FLAG_DATA)); @@ -260,14 +251,6 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme ecma_named_data_property_assign_value (lex_env_p, property_value_p, value); return ECMA_VALUE_EMPTY; } -#else /* JERRY_ESNEXT */ - if (ecma_is_property_writable (*property_p)) - { - ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p); - ecma_named_data_property_assign_value (lex_env_p, property_value_p, value); - return ECMA_VALUE_EMPTY; - } -#endif /* JERRY_ESNEXT */ return ecma_op_raise_set_binding_error (property_p, is_strict); } diff --git a/jerry-core/ecma/operations/ecma-iterator-object.c b/jerry-core/ecma/operations/ecma-iterator-object.c index 21d88724..3e8ef7ea 100644 --- a/jerry-core/ecma/operations/ecma-iterator-object.c +++ b/jerry-core/ecma/operations/ecma-iterator-object.c @@ -36,8 +36,6 @@ * @{ */ -#if JERRY_ESNEXT - /** * Implementation of 'CreateArrayFromList' specialized for iterators * @@ -715,8 +713,6 @@ ecma_async_from_sync_iterator_unwrap_cb (ecma_object_t *function_obj_p, /**< fun return ecma_create_iter_result_object (arg, done); } /* ecma_async_from_sync_iterator_unwrap_cb */ -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/operations/ecma-iterator-object.h b/jerry-core/ecma/operations/ecma-iterator-object.h index f0903508..0963b03f 100644 --- a/jerry-core/ecma/operations/ecma-iterator-object.h +++ b/jerry-core/ecma/operations/ecma-iterator-object.h @@ -18,8 +18,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - /** \addtogroup ecma ECMA * @{ * @@ -78,8 +76,6 @@ ecma_value_t ecma_async_from_sync_iterator_unwrap_cb (ecma_object_t *function_ob const ecma_value_t args_p[], const uint32_t args_count); -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/operations/ecma-jobqueue.c b/jerry-core/ecma/operations/ecma-jobqueue.c index 990e3b7a..3cccfa9b 100644 --- a/jerry-core/ecma/operations/ecma-jobqueue.c +++ b/jerry-core/ecma/operations/ecma-jobqueue.c @@ -26,8 +26,6 @@ #include "opcodes.h" #include "vm-stack.h" -#if JERRY_ESNEXT - /** * Mask for job queue type. */ @@ -637,4 +635,3 @@ ecma_free_all_enqueued_jobs (void) * @} * @} */ -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/operations/ecma-jobqueue.h b/jerry-core/ecma/operations/ecma-jobqueue.h index 72128c2e..b56027ca 100644 --- a/jerry-core/ecma/operations/ecma-jobqueue.h +++ b/jerry-core/ecma/operations/ecma-jobqueue.h @@ -18,8 +18,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - /** \addtogroup ecma ECMA * @{ * @@ -61,5 +59,5 @@ ecma_value_t ecma_process_all_enqueued_jobs (void); * @} * @} */ -#endif /* JERRY_ESNEXT */ + #endif /* !ECMA_JOB_QUEUE_H */ diff --git a/jerry-core/ecma/operations/ecma-lex-env.c b/jerry-core/ecma/operations/ecma-lex-env.c index ea1e8e29..0b04a38f 100644 --- a/jerry-core/ecma/operations/ecma-lex-env.c +++ b/jerry-core/ecma/operations/ecma-lex-env.c @@ -69,7 +69,6 @@ ecma_get_global_environment (ecma_object_t *global_object_p) /**< global object return ECMA_GET_NON_NULL_POINTER (ecma_object_t, ((ecma_global_object_t *) global_object_p)->global_env_cp); } /* ecma_get_global_environment */ -#if JERRY_ESNEXT /** * Create the global lexical block on top of the global environment. */ @@ -88,7 +87,6 @@ ecma_create_global_lexical_block (ecma_object_t *global_object_p) /**< global ob ecma_deref_object (global_scope_p); } } /* ecma_create_global_lexical_block */ -#endif /* JERRY_ESNEXT */ /** * Raise the appropriate error when setting a binding is failed @@ -101,7 +99,6 @@ ecma_op_raise_set_binding_error (ecma_property_t *property_p, /**< property */ { JERRY_UNUSED (property_p); -#if JERRY_ESNEXT const ecma_property_t expected_bits = (ECMA_PROPERTY_FLAG_DATA | ECMA_PROPERTY_FLAG_ENUMERABLE); if ((*property_p & expected_bits) == expected_bits) @@ -117,7 +114,6 @@ ecma_op_raise_set_binding_error (ecma_property_t *property_p, /**< property */ return ecma_raise_type_error (ECMA_ERR_CONSTANT_BINDINGS_CANNOT_BE_REASSIGNED); } -#endif /* JERRY_ESNEXT */ if (is_strict) { @@ -135,12 +131,8 @@ ecma_op_raise_set_binding_error (ecma_property_t *property_p, /**< property */ ecma_object_t * ecma_get_global_scope (ecma_object_t *global_object_p) /**< global object */ { -#if JERRY_ESNEXT JERRY_ASSERT (global_object_p != NULL && ecma_builtin_is_global (global_object_p)); return ECMA_GET_NON_NULL_POINTER (ecma_object_t, ((ecma_global_object_t *) global_object_p)->global_scope_cp); -#else /* !JERRY_ESNEXT */ - return ecma_get_global_environment (global_object_p); -#endif /* !JERRY_ESNEXT */ } /* ecma_get_global_scope */ /** @@ -164,7 +156,6 @@ ecma_op_has_binding (ecma_object_t *lex_env_p, /**< lexical environment */ switch (lex_env_type) { -#if JERRY_ESNEXT case ECMA_LEXICAL_ENVIRONMENT_CLASS: { if (!ECMA_LEX_ENV_CLASS_IS_MODULE (lex_env_p)) @@ -173,7 +164,6 @@ ecma_op_has_binding (ecma_object_t *lex_env_p, /**< lexical environment */ } /* FALLTHRU */ } -#endif /* JERRY_ESNEXT */ case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE: { ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p); @@ -294,7 +284,6 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment switch (ecma_get_lex_env_type (lex_env_p)) { -#if JERRY_ESNEXT case ECMA_LEXICAL_ENVIRONMENT_CLASS: { if (!ECMA_LEX_ENV_CLASS_IS_MODULE (lex_env_p)) @@ -303,7 +292,6 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment } /* FALLTHRU */ } -#endif /* JERRY_ESNEXT */ case ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE: { ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p); @@ -502,7 +490,6 @@ ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, /**< lexical environ prop_value_p->value = ecma_copy_value_if_not_object (value); } /* ecma_op_create_immutable_binding */ -#if JERRY_ESNEXT /** * InitializeBinding operation. * @@ -650,8 +637,6 @@ ecma_op_get_this_binding (ecma_object_t *lex_env_p) /**< lexical environment */ return this_value; } /* ecma_op_get_this_binding */ -#endif /* JERRY_ESNEXT */ - /** * @} * @} diff --git a/jerry-core/ecma/operations/ecma-lex-env.h b/jerry-core/ecma/operations/ecma-lex-env.h index 5b59559c..e71d729f 100644 --- a/jerry-core/ecma/operations/ecma-lex-env.h +++ b/jerry-core/ecma/operations/ecma-lex-env.h @@ -35,9 +35,7 @@ void ecma_init_global_environment (void); void ecma_finalize_global_environment (void); ecma_object_t *ecma_get_global_environment (ecma_object_t *global_object_p); ecma_object_t *ecma_get_global_scope (ecma_object_t *global_object_p); -#if JERRY_ESNEXT void ecma_create_global_lexical_block (ecma_object_t *global_object_p); -#endif /* JERRY_ESNEXT */ ecma_value_t ecma_op_raise_set_binding_error (ecma_property_t *property_p, bool is_strict); #if JERRY_MODULE_SYSTEM @@ -70,7 +68,6 @@ ecma_value_t ecma_op_implicit_this_value (ecma_object_t *lex_env_p); /* ECMA-262 v5, Table 18. Additional methods of Declarative Environment Records */ void ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value); -#if JERRY_ESNEXT void ecma_op_initialize_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value); void ecma_op_create_environment_record (ecma_object_t *lex_env_p, ecma_value_t this_binding, ecma_object_t *func_obj_p); @@ -79,7 +76,6 @@ ecma_environment_record_t *ecma_op_get_environment_record (ecma_object_t *lex_en bool ecma_op_this_binding_is_initialized (ecma_environment_record_t *environment_record_p); void ecma_op_bind_this_value (ecma_environment_record_t *environment_record_p, ecma_value_t this_binding); ecma_value_t ecma_op_get_this_binding (ecma_object_t *lex_env_p); -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/operations/ecma-number-object.c b/jerry-core/ecma/operations/ecma-number-object.c index 4160e765..548f2f73 100644 --- a/jerry-core/ecma/operations/ecma-number-object.c +++ b/jerry-core/ecma/operations/ecma-number-object.c @@ -61,7 +61,7 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb proto_id = ECMA_BUILTIN_ID_OBJECT_PROTOTYPE; #endif /* JERRY_BUILTIN_NUMBER */ ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id); -#if JERRY_ESNEXT + ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p); if (new_target) { @@ -71,7 +71,7 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb return ECMA_VALUE_ERROR; } } -#endif /* JERRY_ESNEXT */ + ecma_object_t *object_p = ecma_create_object (prototype_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS); @@ -80,12 +80,12 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb /* Pass reference (no need to free conv_to_num_completion). */ ext_object_p->u.cls.u3.value = conv_to_num_completion; -#if JERRY_ESNEXT + if (new_target) { ecma_deref_object (prototype_obj_p); } -#endif /* JERRY_ESNEXT */ + return ecma_make_object_value (object_p); } /* ecma_op_create_number_object */ diff --git a/jerry-core/ecma/operations/ecma-objects-general.c b/jerry-core/ecma/operations/ecma-objects-general.c index a6c8f036..eef9f134 100644 --- a/jerry-core/ecma/operations/ecma-objects-general.c +++ b/jerry-core/ecma/operations/ecma-objects-general.c @@ -131,7 +131,6 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */ if (property & ECMA_PROPERTY_FLAG_BUILT_IN) { -#if JERRY_ESNEXT switch (type) { case ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION: @@ -172,17 +171,6 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */ break; } } -#else /* !JERRY_ESNEXT */ - if (type == ECMA_OBJECT_TYPE_CLASS) - { - JERRY_ASSERT (ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_ARGUMENTS)); - ecma_op_arguments_delete_built_in_property (obj_p, property_name_p); - } - else - { - ecma_builtin_delete_built_in_property (obj_p, property_name_p); - } -#endif /* JERRY_ESNEXT */ } /* b. */ @@ -205,7 +193,6 @@ static const lit_magic_string_id_t to_primitive_non_string_hint_method_names[2] LIT_MAGIC_STRING_TO_STRING_UL, /**< toString operation */ }; -#if JERRY_ESNEXT /** * Hints for the ecma general object's toPrimitve operation */ @@ -214,7 +201,6 @@ static const lit_magic_string_id_t hints[3] = { LIT_MAGIC_STRING_NUMBER, /**< "number" hint */ LIT_MAGIC_STRING_STRING, /**< "string" hint */ }; -#endif /* JERRY_ESNEXT */ /** * [[DefaultValue]] ecma general object's operation @@ -232,7 +218,6 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */ { JERRY_ASSERT (obj_p != NULL && !ecma_is_lexical_environment (obj_p)); -#if JERRY_ESNEXT ecma_value_t obj_value = ecma_make_object_value (obj_p); ecma_value_t exotic_to_prim = ecma_op_get_method_by_symbol_id (obj_value, LIT_GLOBAL_SYMBOL_TO_PRIMITIVE); @@ -267,19 +252,6 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */ { hint = ECMA_PREFERRED_TYPE_NUMBER; } -#else /* !JERRY_ESNEXT */ - if (hint == ECMA_PREFERRED_TYPE_NO) - { - hint = ECMA_PREFERRED_TYPE_NUMBER; - -#if JERRY_BUILTIN_DATE - if (ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_DATE)) - { - hint = ECMA_PREFERRED_TYPE_STRING; - } -#endif /* JERRY_BUILTIN_DATE */ - } -#endif /* JERRY_ESNEXT */ return ecma_op_general_object_ordinary_value (obj_p, hint); } /* ecma_op_general_object_default_value */ @@ -637,7 +609,6 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob return ECMA_VALUE_TRUE; } /* ecma_op_general_object_define_own_property */ -#if JERRY_ESNEXT /** * The IsCompatiblePropertyDescriptor method for Proxy object internal methods * @@ -775,7 +746,6 @@ ecma_op_to_complete_property_descriptor (ecma_property_descriptor_t *desc_p) /** desc_p->flags |= (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED); } } /* ecma_op_to_complete_property_descriptor */ -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/operations/ecma-objects-general.h b/jerry-core/ecma/operations/ecma-objects-general.h index aea9959d..210f176c 100644 --- a/jerry-core/ecma/operations/ecma-objects-general.h +++ b/jerry-core/ecma/operations/ecma-objects-general.h @@ -36,13 +36,11 @@ ecma_value_t ecma_op_general_object_define_own_property (ecma_object_t *object_p ecma_string_t *property_name_p, const ecma_property_descriptor_t *property_desc_p); -#if JERRY_ESNEXT void ecma_op_to_complete_property_descriptor (ecma_property_descriptor_t *desc_p); bool ecma_op_is_compatible_property_descriptor (const ecma_property_descriptor_t *desc_p, const ecma_property_descriptor_t *current_p, bool is_extensible); -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/operations/ecma-objects.c b/jerry-core/ecma/operations/ecma-objects.c index 59b8ecde..dfe7215e 100644 --- a/jerry-core/ecma/operations/ecma-objects.c +++ b/jerry-core/ecma/operations/ecma-objects.c @@ -315,34 +315,6 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */ } case ECMA_OBJECT_TYPE_FUNCTION: { -#if !JERRY_ESNEXT - if (ecma_string_is_length (property_name_p)) - { - if (options & ECMA_PROPERTY_GET_VALUE) - { - /* Get length virtual property. */ - ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p; - const ecma_compiled_code_t *bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p); - - uint32_t len; - if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS) - { - cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_data_p; - len = args_p->argument_end; - } - else - { - cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_data_p; - len = args_p->argument_end; - } - - property_ref_p->virtual_value = ecma_make_uint32_value (len); - } - - return ECMA_PROPERTY_VIRTUAL; - } -#endif /* !JERRY_ESNEXT */ - /* Get prototype physical property. */ property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p); break; @@ -690,29 +662,6 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */ } case ECMA_OBJECT_TYPE_FUNCTION: { -#if !JERRY_ESNEXT - if (ecma_string_is_length (property_name_p)) - { - /* Get length virtual property. */ - ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p; - const ecma_compiled_code_t *bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p); - - uint32_t len; - if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS) - { - cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_data_p; - len = args_p->argument_end; - } - else - { - cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_data_p; - len = args_p->argument_end; - } - - return ecma_make_uint32_value (len); - } -#endif /* !JERRY_ESNEXT */ - /* Get prototype physical property. */ property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p); break; @@ -966,8 +915,6 @@ ecma_op_object_get_by_magic_id (ecma_object_t *object_p, /**< the object */ return ecma_op_object_get (object_p, ecma_get_magic_string (property_id)); } /* ecma_op_object_get_by_magic_id */ -#if JERRY_ESNEXT - /** * Descriptor string for each global symbol */ @@ -1064,7 +1011,7 @@ ecma_op_object_get_by_symbol_id (ecma_object_t *object_p, /**< the object */ */ static ecma_value_t ecma_op_get_method (ecma_value_t value, /**< ecma value */ - ecma_string_t *prop_name_p) /** property name */ + ecma_string_t *prop_name_p) /**< property name */ { /* 2. */ ecma_value_t obj_value = ecma_op_to_object (value); @@ -1142,7 +1089,6 @@ ecma_op_get_method_by_magic_id (ecma_value_t value, /**< ecma value */ { return ecma_op_get_method (value, ecma_get_magic_string (magic_id)); } /* ecma_op_get_method_by_magic_id */ -#endif /* JERRY_ESNEXT */ /** * [[Put]] ecma general object's operation specialized for property index @@ -1201,7 +1147,6 @@ ecma_op_object_put (ecma_object_t *object_p, /**< the object */ is_throw); } /* ecma_op_object_put */ -#if JERRY_ESNEXT /** * [[Set]] ( P, V, Receiver) operation part for ordinary objects * @@ -1302,7 +1247,6 @@ ecma_op_object_put_apply_receiver (ecma_value_t receiver, /**< receiver */ return ECMA_VALUE_TRUE; } /* ecma_op_object_put_apply_receiver */ -#endif /* JERRY_ESNEXT */ /** * [[Put]] ecma general object's operation with given receiver @@ -1503,9 +1447,7 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */ if (ecma_string_is_length (property_name_p)) { /* Uninitialized 'length' property is non-writable (ECMA-262 v6, 19.2.4.1) */ -#if JERRY_ESNEXT if (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (((ecma_extended_object_t *) object_p)->u.function.scope_cp)) -#endif /* JERRY_ESNEXT */ { return ecma_raise_readonly_assignment (property_name_p, is_throw); } @@ -1542,12 +1484,10 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */ { if (ecma_is_property_writable (*property_p)) { -#if JERRY_ESNEXT if (ecma_make_object_value (object_p) != receiver) { return ecma_op_object_put_apply_receiver (receiver, property_name_p, value, is_throw); } -#endif /* JERRY_ESNEXT */ /* There is no need for special casing arrays here because changing the * value of an existing property never changes the length of an array. */ @@ -1652,9 +1592,7 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */ } } -#if JERRY_ESNEXT return ecma_op_object_put_apply_receiver (receiver, property_name_p, value, is_throw); -#endif /* JERRY_ESNEXT */ ecma_property_value_t *new_prop_value_p; new_prop_value_p = ecma_create_named_data_property (object_p, @@ -2374,9 +2312,7 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ uint32_t array_index_named_props = 0; uint32_t string_named_props = 0; -#if JERRY_ESNEXT uint32_t symbol_named_props = 0; -#endif /* JERRY_ESNEXT */ while (counter_prop_iter_cp != JMEM_CP_NULL) { @@ -2407,7 +2343,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ { array_index_named_props++; } -#if JERRY_ESNEXT else if (ecma_prop_name_is_symbol (name_p)) { if (!(name_p->u.hash & ECMA_SYMBOL_FLAG_PRIVATE_KEY)) @@ -2415,7 +2350,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ symbol_named_props++; } } -#endif /* JERRY_ESNEXT */ else { string_named_props++; @@ -2439,7 +2373,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ string_named_props = 0; } -#if JERRY_ESNEXT if (filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS) { JERRY_ASSERT (prop_counter.symbol_named_props == 0); @@ -2447,9 +2380,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ } uint32_t total = array_index_named_props + string_named_props + symbol_named_props; -#else /* !JERRY_ESNEXT */ - uint32_t total = array_index_named_props + string_named_props; -#endif /* JERRY_ESNEXT */ if (total == 0) { @@ -2463,7 +2393,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ ecma_value_t *array_index_current_p = buffer_p + array_index_named_props + prop_counter.array_index_named_props; ecma_value_t *string_current_p = array_index_current_p + string_named_props + prop_counter.string_named_props; -#if JERRY_ESNEXT ecma_value_t *symbol_current_p = string_current_p + symbol_named_props + prop_counter.symbol_named_props; if (prop_counter.symbol_named_props > 0 && (array_index_named_props + string_named_props) > 0) @@ -2472,7 +2401,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ (void *) (buffer_p + prop_counter.array_index_named_props + prop_counter.string_named_props), prop_counter.symbol_named_props * sizeof (ecma_value_t)); } -#endif /* JERRY_ESNEXT */ if (prop_counter.string_named_props > 0 && array_index_named_props > 0) { @@ -2514,7 +2442,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ continue; } } -#if JERRY_ESNEXT else if (ecma_prop_name_is_symbol (name_p)) { if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS) && !(name_p->u.hash & ECMA_SYMBOL_FLAG_PRIVATE_KEY)) @@ -2523,7 +2450,6 @@ ecma_op_object_own_property_keys (ecma_object_t *obj_p, /**< object */ continue; } } -#endif /* JERRY_ESNEXT */ else { if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_STRINGS)) @@ -2606,7 +2532,6 @@ ecma_op_object_enumerate (ecma_object_t *obj_p) /**< object */ { ecma_collection_t *keys = ecma_op_object_own_property_keys (obj_p, JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS); -#if JERRY_ESNEXT if (JERRY_UNLIKELY (keys == NULL)) { ecma_collection_free (return_names_p); @@ -2614,19 +2539,16 @@ ecma_op_object_enumerate (ecma_object_t *obj_p) /**< object */ ecma_deref_object (obj_p); return keys; } -#endif /* JERRY_ESNEXT */ for (uint32_t i = 0; i < keys->item_count; i++) { ecma_value_t prop_name = keys->buffer_p[i]; ecma_string_t *name_p = ecma_get_prop_name_from_value (prop_name); -#if JERRY_ESNEXT if (ecma_prop_name_is_symbol (name_p)) { continue; } -#endif /* JERRY_ESNEXT */ ecma_property_descriptor_t prop_desc; ecma_value_t get_desc = ecma_op_object_get_own_property_descriptor (obj_p, name_p, &prop_desc); @@ -2767,7 +2689,6 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */ || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_BIGUINT64ARRAY_PROTOTYPE) #endif /* JERRY_BUILTIN_BIGINT */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_ESNEXT || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAY_PROTOTYPE_UNSCOPABLES) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAY_ITERATOR_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE) @@ -2787,16 +2708,13 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */ || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ASYNC_FUNCTION_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_PROMISE_PROTOTYPE) -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_CONTAINER || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_MAP_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SET_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKMAP_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKSET_PROTOTYPE) -#if JERRY_ESNEXT || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SET_ITERATOR_PROTOTYPE) -#endif /* JERRY_ESNEXT */ #endif /* JERRY_BUILTIN_CONTAINER */ #if JERRY_BUILTIN_WEAKREF || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKREF_PROTOTYPE) @@ -2825,8 +2743,7 @@ static const uint16_t ecma_class_object_magic_string_id[] = { LIT_MAGIC_STRING_MODULE_UL, /**< magic string id of ECMA_OBJECT_CLASS_MODULE_NAMESPACE */ #endif /* JERRY_MODULE_SYSTEM */ -/* These objects are marked by Garbage Collector. */ -#if JERRY_ESNEXT + /* These objects are marked by Garbage Collector. */ LIT_MAGIC_STRING_GENERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_GENERATOR */ LIT_MAGIC_STRING_ASYNC_GENERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_ASYNC_GENERATOR */ LIT_MAGIC_STRING_ARRAY_ITERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_ARRAY_ITERATOR */ @@ -2835,15 +2752,12 @@ static const uint16_t ecma_class_object_magic_string_id[] = { #if JERRY_BUILTIN_REGEXP LIT_MAGIC_STRING_REGEXP_STRING_ITERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_REGEXP_STRING_ITERATOR */ #endif /* JERRY_BUILTIN_REGEXP */ -#endif /* JERRY_ESNEXT */ #if JERRY_MODULE_SYSTEM LIT_MAGIC_STRING_MODULE_UL, /**< magic string id of ECMA_OBJECT_CLASS_MODULE */ #endif /* JERRY_MODULE_SYSTEM */ -#if JERRY_ESNEXT LIT_MAGIC_STRING_PROMISE_UL, /**< magic string id of ECMA_OBJECT_CLASS_PROMISE */ LIT_MAGIC_STRING_OBJECT_UL, /**< magic string id of ECMA_OBJECT_CLASS_PROMISE_CAPABILITY */ LIT_MAGIC_STRING_OBJECT_UL, /**< magic string id of ECMA_OBJECT_CLASS_ASYNC_FROM_SYNC_ITERATOR */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_DATAVIEW LIT_MAGIC_STRING_DATAVIEW_UL, /**< magic string id of ECMA_OBJECT_CLASS_DATAVIEW */ #endif /* JERRY_BUILTIN_DATAVIEW */ @@ -2865,10 +2779,8 @@ static const uint16_t ecma_class_object_magic_string_id[] = { #if JERRY_BUILTIN_REGEXP LIT_MAGIC_STRING_REGEXP_UL, /**< magic string id of ECMA_OBJECT_CLASS_REGEXP */ #endif /* JERRY_BUILTIN_REGEXP */ -#if JERRY_ESNEXT LIT_MAGIC_STRING_SYMBOL_UL, /**< magic string id of ECMA_OBJECT_CLASS_SYMBOL */ LIT_MAGIC_STRING_STRING_ITERATOR_UL, /**< magic string id of ECMA_OBJECT_CLASS_STRING_ITERATOR */ -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_TYPEDARRAY LIT_MAGIC_STRING_ARRAY_BUFFER_UL, /**< magic string id of ECMA_OBJECT_CLASS_ARRAY_BUFFER */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ @@ -2972,7 +2884,6 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */ return LIT_MAGIC_STRING_REFLECT_UL; } #endif /* JERRY_BUILTIN_REFLECT */ -#if JERRY_ESNEXT case ECMA_BUILTIN_ID_GENERATOR: { return LIT_MAGIC_STRING_GENERATOR_UL; @@ -2981,7 +2892,6 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */ { return LIT_MAGIC_STRING_ASYNC_GENERATOR_UL; } -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_JSON case ECMA_BUILTIN_ID_JSON: { @@ -2994,20 +2904,6 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */ return LIT_MAGIC_STRING_ATOMICS_U; } #endif /* JERRY_BUILTIN_ATOMICS */ -#if !JERRY_ESNEXT -#if JERRY_BUILTIN_ERRORS - case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE: - case ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE: - case ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE: - case ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE: - case ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE: - case ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE: -#endif /* JERRY_BUILTIN_ERRORS */ - case ECMA_BUILTIN_ID_ERROR_PROTOTYPE: - { - return LIT_MAGIC_STRING_ERROR_UL; - } -#endif /* !JERRY_ESNEXT */ default: { break; @@ -3041,7 +2937,6 @@ ecma_object_is_regexp_object (ecma_value_t arg) /**< argument */ } /* ecma_object_is_regexp_object */ #endif /* JERRY_BUILTIN_REGEXP */ -#if JERRY_ESNEXT /** * Object's IsConcatSpreadable operation, used for Array.prototype.concat * It checks the argument's [Symbol.isConcatSpreadable] property value @@ -3187,7 +3082,6 @@ ecma_op_invoke_by_symbol_id (ecma_value_t object, /**< Object value */ return ret_value; } /* ecma_op_invoke_by_symbol_id */ -#endif /* JERRY_ESNEXT */ /** * 7.3.18 Abstract operation Invoke when property name is a magic string @@ -3225,13 +3119,7 @@ ecma_op_invoke (ecma_value_t object, /**< Object value */ ecma_object_t *object_p = ecma_get_object_from_value (object_value); -#if JERRY_ESNEXT - ecma_value_t this_arg = object; -#else /* !JERRY_ESNEXT */ - ecma_value_t this_arg = object_value; -#endif /* JERRY_ESNEXT */ - - ecma_value_t func = ecma_op_object_get_with_receiver (object_p, property_name_p, this_arg); + ecma_value_t func = ecma_op_object_get_with_receiver (object_p, property_name_p, object); if (ECMA_IS_VALUE_ERROR (func)) { @@ -3240,7 +3128,7 @@ ecma_op_invoke (ecma_value_t object, /**< Object value */ } /* 4. */ - ecma_value_t call_result = ecma_op_function_validated_call (func, this_arg, args_p, args_len); + ecma_value_t call_result = ecma_op_function_validated_call (func, object, args_p, args_len); ecma_free_value (func); ecma_deref_object (object_p); diff --git a/jerry-core/ecma/operations/ecma-objects.h b/jerry-core/ecma/operations/ecma-objects.h index 31c51faf..87e25388 100644 --- a/jerry-core/ecma/operations/ecma-objects.h +++ b/jerry-core/ecma/operations/ecma-objects.h @@ -69,13 +69,11 @@ ecma_op_object_get_with_receiver (ecma_object_t *object_p, ecma_string_t *proper ecma_value_t ecma_op_object_get_length (ecma_object_t *object_p, ecma_length_t *length_p); ecma_value_t ecma_op_object_get_by_index (ecma_object_t *object_p, ecma_length_t index); ecma_value_t ecma_op_object_get_by_magic_id (ecma_object_t *object_p, lit_magic_string_id_t property_id); -#if JERRY_ESNEXT ecma_string_t *ecma_op_get_global_symbol (lit_magic_string_id_t property_id); bool ecma_op_compare_string_to_global_symbol (ecma_string_t *string_p, lit_magic_string_id_t property_id); ecma_value_t ecma_op_object_get_by_symbol_id (ecma_object_t *object_p, lit_magic_string_id_t property_id); ecma_value_t ecma_op_get_method_by_symbol_id (ecma_value_t value, lit_magic_string_id_t symbol_id); ecma_value_t ecma_op_get_method_by_magic_id (ecma_value_t value, lit_magic_string_id_t magic_id); -#endif /* JERRY_ESNEXT */ ecma_value_t ecma_op_object_put_with_receiver (ecma_object_t *object_p, ecma_string_t *property_name_p, ecma_value_t value, @@ -112,7 +110,6 @@ lit_magic_string_id_t ecma_object_get_class_name (ecma_object_t *obj_p); #if JERRY_BUILTIN_REGEXP bool ecma_object_is_regexp_object (ecma_value_t arg); #endif /* JERRY_BUILTIN_REGEXP */ -#if JERRY_ESNEXT ecma_value_t ecma_op_is_concat_spreadable (ecma_value_t arg); ecma_value_t ecma_op_is_regexp (ecma_value_t arg); ecma_value_t ecma_op_species_constructor (ecma_object_t *this_value, ecma_builtin_id_t default_constructor_id); @@ -120,7 +117,6 @@ ecma_value_t ecma_op_invoke_by_symbol_id (ecma_value_t object, lit_magic_string_id_t magic_string_id, ecma_value_t *args_p, uint32_t args_len); -#endif /* JERRY_ESNEXT */ #if JERRY_BUILTIN_WEAKREF || JERRY_BUILTIN_CONTAINER void ecma_op_object_set_weak (ecma_object_t *object_p, ecma_object_t *target_p); void ecma_op_object_unref_weak (ecma_object_t *object_p, ecma_value_t ref_holder); diff --git a/jerry-core/ecma/operations/ecma-promise-object.c b/jerry-core/ecma/operations/ecma-promise-object.c index 746a841e..092ed773 100644 --- a/jerry-core/ecma/operations/ecma-promise-object.c +++ b/jerry-core/ecma/operations/ecma-promise-object.c @@ -31,8 +31,6 @@ #include "jcontext.h" -#if JERRY_ESNEXT - /** \addtogroup ecma ECMA * @{ * @@ -1331,4 +1329,3 @@ ecma_promise_perform_then (ecma_value_t promise, /**< the promise which call 'th * @} * @} */ -#endif /* JERRY_ESNEXT */ diff --git a/jerry-core/ecma/operations/ecma-promise-object.h b/jerry-core/ecma/operations/ecma-promise-object.h index 54c88d9a..8cfaa454 100644 --- a/jerry-core/ecma/operations/ecma-promise-object.h +++ b/jerry-core/ecma/operations/ecma-promise-object.h @@ -18,8 +18,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - /** \addtogroup ecma ECMA * @{ * @@ -46,8 +44,8 @@ typedef enum */ typedef struct { - ecma_extended_object_t header; - ecma_value_t promise; + ecma_extended_object_t header; /**< extended object part */ + ecma_value_t promise; /**< [[Promise]] internal slot */ } ecma_promise_resolver_t; /** @@ -145,5 +143,4 @@ ecma_value_t ecma_promise_perform_then (ecma_value_t promise, * @} */ -#endif /* JERRY_ESNEXT */ #endif /* !ECMA_PROMISE_OBJECT_H */ diff --git a/jerry-core/ecma/operations/ecma-reference.c b/jerry-core/ecma/operations/ecma-reference.c index d5e970b2..bf279440 100644 --- a/jerry-core/ecma/operations/ecma-reference.c +++ b/jerry-core/ecma/operations/ecma-reference.c @@ -72,8 +72,6 @@ ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical } } /* ecma_op_resolve_reference_base */ -#if JERRY_ESNEXT - /** * Check if the passed lexical environment is a global lexical environment * @@ -192,8 +190,6 @@ ecma_op_is_prop_unscopable (ecma_object_t *binding_obj_p, /**< binding object */ return ECMA_VALUE_FALSE; } /* ecma_op_is_prop_unscopable */ -#endif /* JERRY_ESNEXT */ - /** * Helper method for HasBindig operation * @@ -244,9 +240,7 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env return found_binding; } -#if JERRY_ESNEXT if (JERRY_LIKELY (ecma_op_is_global_environment (lex_env_p))) -#endif /* JERRY_ESNEXT */ { return found_binding; } @@ -254,7 +248,6 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env } #endif /* JERRY_BUILTIN_PROXY */ -#if JERRY_ESNEXT ecma_value_t blocked = ecma_op_is_prop_unscopable (binding_obj_p, name_p); if (ecma_is_value_false (blocked)) @@ -276,7 +269,6 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env #endif /* JERRY_BUILTIN_PROXY */ return ECMA_IS_VALUE_ERROR (blocked) ? blocked : ECMA_VALUE_NOT_FOUND; -#endif /* JERRY_ESNEXT */ } /* ecma_op_object_bound_environment_resolve_reference_value */ /** @@ -305,16 +297,13 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p); -#if JERRY_ESNEXT if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED)) { return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED); } -#endif /* JERRY_ESNEXT */ return ecma_fast_copy_value (property_value_p->value); } -#if JERRY_ESNEXT case ECMA_LEXICAL_ENVIRONMENT_CLASS: { #if JERRY_MODULE_SYSTEM @@ -344,17 +333,11 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical #endif /* JERRY_MODULE_SYSTEM */ break; } -#endif /* JERRY_ESNEXT */ default: { JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND); -#if JERRY_ESNEXT - bool lcache_lookup_allowed = ecma_op_is_global_environment (lex_env_p); -#else /* !JERRY_ESNEXT*/ - bool lcache_lookup_allowed = true; -#endif /* JERRY_ESNEXT */ - if (lcache_lookup_allowed) + if (ecma_op_is_global_environment (lex_env_p)) { #if JERRY_LCACHE ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p); diff --git a/jerry-core/ecma/operations/ecma-reference.h b/jerry-core/ecma/operations/ecma-reference.h index ece9b497..e1d4ae79 100644 --- a/jerry-core/ecma/operations/ecma-reference.h +++ b/jerry-core/ecma/operations/ecma-reference.h @@ -30,9 +30,7 @@ ecma_object_t *ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, ecma_string_t *name_p); ecma_value_t ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, ecma_string_t *name_p); ecma_value_t ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env_p, ecma_string_t *name_p); -#if JERRY_ESNEXT ecma_value_t ecma_op_resolve_super_base (ecma_object_t *lex_env_p); -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/operations/ecma-regexp-object.c b/jerry-core/ecma/operations/ecma-regexp-object.c index 31a479cb..e5b276ae 100644 --- a/jerry-core/ecma/operations/ecma-regexp-object.c +++ b/jerry-core/ecma/operations/ecma-regexp-object.c @@ -98,13 +98,11 @@ ecma_regexp_parse_flags (ecma_string_t *flags_str_p, /**< Input string with flag flag = RE_FLAG_UNICODE; break; } -#if JERRY_ESNEXT case 's': { flag = RE_FLAG_DOTALL; break; } -#endif /* JERRY_ESNEXT */ default: { flag = RE_FLAG_EMPTY; @@ -127,81 +125,6 @@ ecma_regexp_parse_flags (ecma_string_t *flags_str_p, /**< Input string with flag return ret_value; } /* ecma_regexp_parse_flags */ -#if !JERRY_ESNEXT -/* - * Create the properties of a RegExp instance. - */ -static void -ecma_regexp_create_props (ecma_object_t *re_object_p, /**< RegExp object */ - ecma_string_t *source_p, /**< source string */ - uint16_t flags) /**< flags */ -{ - ecma_property_value_t *prop_value_p; - - prop_value_p = ecma_create_named_data_property (re_object_p, - ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE), - ECMA_PROPERTY_FIXED, - NULL); - - ecma_ref_ecma_string (source_p); - prop_value_p->value = ecma_make_string_value (source_p); - - prop_value_p = ecma_create_named_data_property (re_object_p, - ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL), - ECMA_PROPERTY_FIXED, - NULL); - - prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_GLOBAL); - - prop_value_p = ecma_create_named_data_property (re_object_p, - ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL), - ECMA_PROPERTY_FIXED, - NULL); - - prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_IGNORE_CASE); - - prop_value_p = ecma_create_named_data_property (re_object_p, - ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE), - ECMA_PROPERTY_FIXED, - NULL); - - prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_MULTILINE); -} /* ecma_regexp_create_props */ - -/* - * Update the properties of a RegExp instance. - */ -static void -ecma_regexp_update_props (ecma_object_t *re_object_p, /**< RegExp object */ - ecma_string_t *source_p, /**< source string */ - uint16_t flags) /**< flags */ -{ - ecma_property_t *prop_p; - - prop_p = ecma_find_named_property (re_object_p, ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE)); - JERRY_ASSERT (prop_p != NULL); - ecma_property_value_t *prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p); - ecma_free_value (prop_value_p->value); - ecma_ref_ecma_string (source_p); - prop_value_p->value = ecma_make_string_value (source_p); - - prop_p = ecma_find_named_property (re_object_p, ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL)); - JERRY_ASSERT (prop_p != NULL); - prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p); - prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_GLOBAL); - - prop_p = ecma_find_named_property (re_object_p, ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL)); - JERRY_ASSERT (prop_p != NULL); - prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p); - prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_IGNORE_CASE); - - prop_p = ecma_find_named_property (re_object_p, ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE)); - JERRY_ASSERT (prop_p != NULL); - prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p); - prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_MULTILINE); -} /* ecma_regexp_update_props */ -#endif /* !JERRY_ESNEXT */ - /** * RegExpAlloc method * @@ -216,7 +139,6 @@ ecma_regexp_update_props (ecma_object_t *re_object_p, /**< RegExp object */ ecma_object_t * ecma_op_regexp_alloc (ecma_object_t *ctr_obj_p) /**< constructor object pointer */ { -#if JERRY_ESNEXT if (ctr_obj_p == NULL) { ctr_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP); @@ -229,17 +151,10 @@ ecma_op_regexp_alloc (ecma_object_t *ctr_obj_p) /**< constructor object pointer return proto_obj_p; } -#else /* !JERRY_ESNEXT */ - JERRY_UNUSED (ctr_obj_p); - ecma_object_t *proto_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE); -#endif /* JERRY_ESNEXT */ - ecma_object_t *new_object_p = ecma_create_object (proto_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS); -#if JERRY_ESNEXT ecma_deref_object (proto_obj_p); -#endif /* JERRY_ESNEXT */ ecma_extended_object_t *regexp_obj_p = (ecma_extended_object_t *) new_object_p; @@ -259,31 +174,11 @@ ecma_op_regexp_alloc (ecma_object_t *ctr_obj_p) /**< constructor object pointer /** * Helper method for initializing an aready existing RegExp object. */ -static void +static inline void JERRY_ATTR_ALWAYS_INLINE ecma_op_regexp_initialize (ecma_object_t *regexp_obj_p, /**< RegExp object */ - const re_compiled_code_t *bc_p, /**< bytecode */ - ecma_string_t *pattern_str_p, /**< pattern */ - uint16_t flags) /**< flags */ + const re_compiled_code_t *bc_p) /**< bytecode */ { ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) regexp_obj_p; - -#if !JERRY_ESNEXT - if (ext_obj_p->u.cls.type == ECMA_OBJECT_CLASS__MAX) - { - /* This instance has not been initialized before. */ - ecma_regexp_create_props (regexp_obj_p, pattern_str_p, flags); - } - else - { - ecma_regexp_update_props (regexp_obj_p, pattern_str_p, flags); - } -#endif /* !JERRY_ESNEXT */ - -#if JERRY_ESNEXT - JERRY_UNUSED (pattern_str_p); - JERRY_UNUSED (flags); -#endif /* JERRY_ESNEXT */ - ext_obj_p->u.cls.type = ECMA_OBJECT_CLASS_REGEXP; ECMA_SET_INTERNAL_VALUE_POINTER (ext_obj_p->u.cls.u3.value, bc_p); } /* ecma_op_regexp_initialize */ @@ -339,7 +234,7 @@ ecma_op_create_regexp_from_pattern (ecma_object_t *regexp_obj_p, /**< RegExp obj return ECMA_VALUE_ERROR; } - ecma_op_regexp_initialize (regexp_obj_p, bc_p, pattern_str_p, flags); + ecma_op_regexp_initialize (regexp_obj_p, bc_p); ecma_deref_ecma_string (pattern_str_p); return ecma_make_object_value (regexp_obj_p); @@ -358,10 +253,8 @@ ecma_op_create_regexp_from_bytecode (ecma_object_t *regexp_obj_p, /**< RegExp ob re_compiled_code_t *bc_p) /**< bytecode */ { ecma_bytecode_ref ((ecma_compiled_code_t *) bc_p); - ecma_string_t *pattern_str_p = ecma_get_string_from_value (bc_p->source); - uint16_t flags = bc_p->header.status_flags; - ecma_op_regexp_initialize (regexp_obj_p, bc_p, pattern_str_p, flags); + ecma_op_regexp_initialize (regexp_obj_p, bc_p); return ecma_make_object_value (regexp_obj_p); } /* ecma_op_create_regexp_from_bytecode */ @@ -394,7 +287,7 @@ ecma_op_create_regexp_with_flags (ecma_object_t *regexp_obj_p, /**< RegExp objec return ECMA_VALUE_ERROR; } - ecma_op_regexp_initialize (regexp_obj_p, bc_p, pattern_str_p, flags); + ecma_op_regexp_initialize (regexp_obj_p, bc_p); return ecma_make_object_value (regexp_obj_p); } /* ecma_op_create_regexp_with_flags */ @@ -408,7 +301,6 @@ lit_code_point_t ecma_regexp_canonicalize_char (lit_code_point_t ch, /**< character */ bool unicode) /**< unicode */ { -#if JERRY_ESNEXT if (unicode) { /* In unicode mode the mappings contained in the CaseFolding.txt file should be used to canonicalize the character. @@ -432,7 +324,6 @@ ecma_regexp_canonicalize_char (lit_code_point_t ch, /**< character */ return ch; } -#endif /* !JERRY_ESNEXT */ JERRY_UNUSED (unicode); lit_code_point_t cu = lit_char_to_upper_case (ch, NULL); @@ -520,7 +411,6 @@ ecma_regexp_advance (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */ JERRY_ASSERT (str_p != NULL); lit_code_point_t cp = lit_cesu8_read_next (str_p); -#if JERRY_ESNEXT if (JERRY_UNLIKELY (re_ctx_p->flags & RE_FLAG_UNICODE) && lit_is_code_point_utf16_high_surrogate ((ecma_char_t) cp) && *str_p < re_ctx_p->input_end_p) { @@ -531,12 +421,10 @@ ecma_regexp_advance (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */ *str_p += LIT_UTF8_MAX_BYTES_IN_CODE_UNIT; } } -#endif /* JERRY_ESNEXT */ return ecma_regexp_canonicalize (cp, re_ctx_p->flags); } /* ecma_regexp_advance */ -#if JERRY_ESNEXT /** * Helper function to get current full unicode code point and advance the string pointer. * @@ -563,7 +451,6 @@ ecma_regexp_unicode_advance (const lit_utf8_byte_t **str_p, /**< reference to st *str_p = current_p; return ch; } /* ecma_regexp_unicode_advance */ -#endif /* JERRY_ESNEXT */ /** * Helper function to revert the string pointer to the previous code point. @@ -575,17 +462,14 @@ ecma_regexp_step_back (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */ const lit_utf8_byte_t *str_p) /**< reference to string pointer */ { JERRY_ASSERT (str_p != NULL); -#if JERRY_ESNEXT + lit_code_point_t ch = lit_cesu8_read_prev (&str_p); if (JERRY_UNLIKELY (re_ctx_p->flags & RE_FLAG_UNICODE) && lit_is_code_point_utf16_low_surrogate (ch) && lit_is_code_point_utf16_high_surrogate (lit_cesu8_peek_prev (str_p))) { str_p -= LIT_UTF8_MAX_BYTES_IN_CODE_UNIT; } -#else /* !JERRY_ESNEXT */ - JERRY_UNUSED (re_ctx_p); - lit_utf8_decr (&str_p); -#endif /* !JERRY_ESNEXT */ + return str_p; } /* ecma_regexp_step_back */ @@ -606,7 +490,6 @@ ecma_regexp_is_word_boundary (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context * { left_cp = LIT_INVALID_CP; } -#if JERRY_ESNEXT else if (JERRY_UNLIKELY ((re_ctx_p->flags & (RE_FLAG_UNICODE | RE_FLAG_IGNORE_CASE)) == (RE_FLAG_UNICODE | RE_FLAG_IGNORE_CASE))) { @@ -614,7 +497,6 @@ ecma_regexp_is_word_boundary (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context * left_cp = ecma_regexp_advance (re_ctx_p, &prev_p); JERRY_ASSERT (prev_p == str_p); } -#endif /* JERRY_ESNEXT */ else { left_cp = str_p[-1]; @@ -624,13 +506,11 @@ ecma_regexp_is_word_boundary (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context * { right_cp = LIT_INVALID_CP; } -#if JERRY_ESNEXT else if (JERRY_UNLIKELY ((re_ctx_p->flags & (RE_FLAG_UNICODE | RE_FLAG_IGNORE_CASE)) == (RE_FLAG_UNICODE | RE_FLAG_IGNORE_CASE))) { right_cp = ecma_regexp_advance (re_ctx_p, &str_p); } -#endif /* JERRY_ESNEXT */ else { right_cp = str_p[0]; @@ -1494,7 +1374,6 @@ class_found: bc_p = bc_p + escape_count + chars_size + ranges_size; continue; } -#if JERRY_ESNEXT case RE_OP_UNICODE_PERIOD: { if (str_curr_p >= re_ctx_p->input_end_p) @@ -1512,7 +1391,6 @@ class_found: continue; } -#endif /* JERRY_ESNEXT */ case RE_OP_PERIOD: { if (str_curr_p >= re_ctx_p->input_end_p) @@ -1521,13 +1399,8 @@ class_found: } const ecma_char_t ch = lit_cesu8_read_next (&str_curr_p); -#if !JERRY_ESNEXT - bool has_dot_all_flag = false; -#else /* JERRY_ESNEXT */ - bool has_dot_all_flag = (re_ctx_p->flags & RE_FLAG_DOTALL) != 0; -#endif /* !JERRY_ESNEXT */ - if (!has_dot_all_flag && lit_char_is_line_terminator (ch)) + if (!(re_ctx_p->flags & RE_FLAG_DOTALL) && lit_char_is_line_terminator (ch)) { goto fail; } @@ -1744,24 +1617,8 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */ ecma_length_t index = 0; ecma_value_t lastindex_value = ecma_op_object_get_by_magic_id (regexp_object_p, LIT_MAGIC_STRING_LASTINDEX_UL); -#if JERRY_ESNEXT ret_value = ecma_op_to_length (lastindex_value, &index); ecma_free_value (lastindex_value); -#else /* !JERRY_ESNEXT */ - ecma_number_t lastindex_num = 0.0f; - ret_value = ecma_op_to_integer (lastindex_value, &lastindex_num); - ecma_free_value (lastindex_value); - - /* The ToInteger operation might have thrown an error, however in that case lastindex_num will still be zero, - * and the error will be handled later after the uint32 coercion. */ - if ((re_ctx.flags & RE_FLAG_GLOBAL) && lastindex_num < 0.0f) - { - JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (ret_value)); - goto fail_put_lastindex; - } - - index = ecma_number_to_uint32 (lastindex_num); -#endif /* JERRY_ESNEXT */ if (ECMA_IS_VALUE_ERROR (ret_value)) { @@ -1814,13 +1671,11 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */ goto match_found; } -#if JERRY_ESNEXT /* 12.c.i */ if (re_ctx.flags & RE_FLAG_STICKY) { goto fail_put_lastindex; } -#endif /* JERRY_ESNEXT */ /* 12.a */ if (input_curr_p >= input_end_p) @@ -1838,7 +1693,6 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */ /* 12.c.ii */ index++; -#if JERRY_ESNEXT if (re_ctx.flags & RE_FLAG_UNICODE) { const lit_code_point_t cp = ecma_regexp_unicode_advance (&input_curr_p, input_end_p); @@ -1850,7 +1704,6 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */ continue; } -#endif /* JERRY_ESNEXT */ lit_utf8_incr (&input_curr_p); } @@ -2075,7 +1928,6 @@ ecma_regexp_split_helper (ecma_value_t this_arg, /**< this value */ ecma_value_t string_arg, /**< string value */ ecma_value_t limit_arg) /**< limit value */ { -#if JERRY_ESNEXT /* 2. */ if (!ecma_is_value_object (this_arg)) { @@ -2389,169 +2241,6 @@ cleanup_string: ecma_deref_ecma_string (string_p); return result; -#else /* !JERRY_ESNEXT */ - ecma_value_t result = ECMA_VALUE_ERROR; - - /* 2. */ - ecma_string_t *string_p = ecma_op_to_string (string_arg); - if (JERRY_UNLIKELY (string_p == NULL)) - { - return result; - } - - /* 5. */ - uint32_t limit = UINT32_MAX; - if (!ecma_is_value_undefined (limit_arg)) - { - if (ECMA_IS_VALUE_ERROR (ecma_op_to_length (limit_arg, &limit))) - { - goto cleanup_string; - } - } - - /* 15. */ - ecma_object_t *const array_p = ecma_op_new_array_object (0); - ecma_value_t array = ecma_make_object_value (array_p); - - /* 21. */ - if (limit == 0) - { - result = array; - goto cleanup_string; - } - - uint32_t array_length = 0; - - ecma_object_t *const regexp_p = ecma_get_object_from_value (this_arg); - ecma_extended_object_t *const ext_object_p = (ecma_extended_object_t *) regexp_p; - re_compiled_code_t *const bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t, ext_object_p->u.cls.u3.value); - - lit_utf8_size_t string_size; - lit_utf8_size_t string_length; - uint8_t string_flags = ECMA_STRING_FLAG_IS_ASCII; - const lit_utf8_byte_t *string_buffer_p = - ecma_string_get_chars (string_p, &string_size, &string_length, NULL, &string_flags); - - const lit_utf8_byte_t *current_str_p = string_buffer_p; - const lit_utf8_byte_t *previous_str_p = string_buffer_p; - const lit_utf8_byte_t *const string_end_p = string_buffer_p + string_size; - - ecma_regexp_ctx_t re_ctx; - ecma_regexp_initialize_context (&re_ctx, bc_p, string_buffer_p, string_buffer_p + string_size); - - uint8_t *const bc_start_p = (uint8_t *) (bc_p + 1); - - if (string_length == 0) - { - const lit_utf8_byte_t *const matched_p = ecma_regexp_match (&re_ctx, bc_start_p, current_str_p); - - if (ECMA_RE_STACK_LIMIT_REACHED (matched_p)) - { - result = ecma_raise_range_error (ECMA_ERR_STACK_LIMIT_EXCEEDED); - goto cleanup_array; - } - - if (matched_p == NULL) - { - result = ecma_builtin_helper_def_prop_by_index (array_p, - array_length, - ecma_make_string_value (string_p), - ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE); - JERRY_ASSERT (ecma_is_value_true (result)); - } - - result = array; - goto cleanup_context; - } - - /* 13. */ - while (current_str_p < string_end_p) - { - /* 13.a. */ - const lit_utf8_byte_t *const matched_p = ecma_regexp_match (&re_ctx, bc_start_p, current_str_p); - - if (ECMA_RE_STACK_LIMIT_REACHED (matched_p)) - { - result = ecma_raise_range_error (ECMA_ERR_STACK_LIMIT_EXCEEDED); - goto cleanup_array; - } - - if (matched_p == NULL || matched_p == previous_str_p) - { - lit_utf8_incr (¤t_str_p); - continue; - } - - /* 13.c.iii.1. */ - ecma_string_t *const str_p = - ecma_new_ecma_string_from_utf8 (previous_str_p, (lit_utf8_size_t) (current_str_p - previous_str_p)); - - result = ecma_builtin_helper_def_prop_by_index (array_p, - array_length++, - ecma_make_string_value (str_p), - ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE); - JERRY_ASSERT (ecma_is_value_true (result)); - ecma_deref_ecma_string (str_p); - - if (array_length == limit) - { - result = array; - goto cleanup_context; - } - - /* 13.c.iii.5. */ - previous_str_p = matched_p; - - uint32_t index = 1; - while (index < re_ctx.captures_count) - { - const ecma_value_t capture = ecma_regexp_get_capture_value (re_ctx.captures_p + index); - result = ecma_builtin_helper_def_prop_by_index (array_p, - array_length++, - capture, - ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE); - JERRY_ASSERT (ecma_is_value_true (result)); - ecma_free_value (capture); - - if (array_length == limit) - { - result = array; - goto cleanup_context; - } - - index++; - } - - /* 13.c.iii.8. */ - current_str_p = matched_p; - } - - ecma_string_t *const str_p = - ecma_new_ecma_string_from_utf8 (previous_str_p, (lit_utf8_size_t) (string_end_p - previous_str_p)); - - result = ecma_builtin_helper_def_prop_by_index (array_p, - array_length++, - ecma_make_string_value (str_p), - ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE); - JERRY_ASSERT (ecma_is_value_true (result)); - ecma_deref_ecma_string (str_p); - - result = array; - goto cleanup_context; - -cleanup_array: - ecma_deref_object (array_p); -cleanup_context: - ecma_regexp_cleanup_context (&re_ctx); - if (string_flags & ECMA_STRING_FLAG_MUST_BE_FREED) - { - jmem_heap_free_block ((void *) string_buffer_p, string_size); - } -cleanup_string: - ecma_deref_ecma_string (string_p); - - return result; -#endif /* JERRY_ESNEXT */ } /* ecma_regexp_split_helper */ /** @@ -2606,7 +2295,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont goto cleanup_context; } -#if JERRY_ESNEXT /* Only non-global sticky matches use the lastIndex value, otherwise the starting index is 0. */ if (JERRY_UNLIKELY ((ctx_p->flags & RE_FLAG_GLOBAL) == 0 && (re_ctx.flags & RE_FLAG_STICKY) != 0)) { @@ -2641,7 +2329,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont } } else -#endif /* JERRY_ESNEXT */ { index = 0; } @@ -2723,7 +2410,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont if (!(ctx_p->flags & RE_FLAG_GLOBAL)) { -#if JERRY_ESNEXT if (JERRY_UNLIKELY ((re_ctx.flags & RE_FLAG_STICKY) != 0)) { ecma_value_t index_value = ecma_make_length_value (index); @@ -2739,7 +2425,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont goto cleanup_builder; } } -#endif /* JERRY_ESNEXT */ break; } @@ -2750,7 +2435,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont continue; } } -#if JERRY_ESNEXT else if (JERRY_UNLIKELY ((re_ctx.flags & RE_FLAG_STICKY) != 0)) { result = ecma_op_object_put ((ecma_object_t *) re_obj_p, @@ -2765,14 +2449,12 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont break; } -#endif /* JERRY_ESNEXT */ if (current_p >= string_end_p) { break; } -#if JERRY_ESNEXT if ((ctx_p->flags & RE_FLAG_UNICODE) != 0) { index++; @@ -2785,7 +2467,6 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont continue; } -#endif /* JERRY_ESNEXT */ index++; lit_utf8_incr (¤t_p); @@ -2873,14 +2554,11 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */ ecma_free_value (result); -#if JERRY_ESNEXT const lit_utf8_size_t string_length = ecma_string_get_length (string_p); -#endif /* JERRY_ESNEXT */ /* 10. */ if (replace_ctx.flags & RE_FLAG_GLOBAL) { -#if JERRY_ESNEXT result = ecma_op_object_get_by_magic_id (this_obj_p, LIT_MAGIC_STRING_UNICODE); if (ECMA_IS_VALUE_ERROR (result)) { @@ -2893,7 +2571,6 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */ } ecma_free_value (result); -#endif /* JERRY_ESNEXT */ result = ecma_op_object_put (this_obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL), @@ -2907,11 +2584,6 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */ JERRY_ASSERT (ecma_is_value_boolean (result)); } -#if !JERRY_ESNEXT - result = ecma_regexp_replace_helper_fast (&replace_ctx, (ecma_extended_object_t *) this_obj_p, string_p, replace_arg); - - goto cleanup_replace; -#else /* JERRY_ESNEXT */ result = ecma_op_object_get_by_magic_id (this_obj_p, LIT_MAGIC_STRING_EXEC); if (ECMA_IS_VALUE_ERROR (result)) @@ -3276,7 +2948,6 @@ cleanup_chars: cleanup_results: ecma_collection_free (results_p); -#endif /* !JERRY_ESNEXT */ cleanup_replace: if (replace_ctx.replace_str_p != NULL) @@ -3336,7 +3007,6 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */ return result; } -#if JERRY_ESNEXT ecma_value_t full_unicode_value = ecma_op_object_get_by_magic_id (obj_p, LIT_MAGIC_STRING_UNICODE); if (ECMA_IS_VALUE_ERROR (full_unicode_value)) @@ -3348,7 +3018,6 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */ bool full_unicode = ecma_op_to_boolean (full_unicode_value); ecma_free_value (full_unicode_value); -#endif /* JERRY_ESNEXT */ ecma_value_t set_status = ecma_op_object_put (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL), ecma_make_uint32_value (0), true); @@ -3421,7 +3090,6 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */ goto result_cleanup; } -#if JERRY_ESNEXT ecma_length_t index; ecma_value_t length_value = ecma_op_to_length (last_index, &index); @@ -3437,15 +3105,7 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */ last_index = ecma_make_length_value (index); ecma_value_t next_set_status = ecma_op_object_put (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL), last_index, true); -#else /* !JERRY_ESNEXT */ - ecma_number_t index = ecma_get_number_from_value (last_index); - ecma_free_value (last_index); - - last_index = ecma_make_number_value (index + 1); - ecma_value_t next_set_status = - ecma_op_object_put (obj_p, ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL), last_index, true); -#endif /* JERRY_ESNEXT */ ecma_free_value (last_index); if (ECMA_IS_VALUE_ERROR (next_set_status)) @@ -3478,7 +3138,6 @@ ecma_op_regexp_exec (ecma_value_t this_arg, /**< this argument */ { ecma_object_t *arg_obj_p = ecma_get_object_from_value (this_arg); -#if JERRY_ESNEXT ecma_value_t exec = ecma_op_object_get_by_magic_id (arg_obj_p, LIT_MAGIC_STRING_EXEC); if (ECMA_IS_VALUE_ERROR (exec)) @@ -3512,7 +3171,6 @@ ecma_op_regexp_exec (ecma_value_t this_arg, /**< this argument */ { ecma_free_value (exec); } -#endif /* JERRY_ESNEXT */ if (!ecma_object_is_regexp_object (this_arg)) { diff --git a/jerry-core/ecma/operations/ecma-regexp-object.h b/jerry-core/ecma/operations/ecma-regexp-object.h index 5c97049f..89815897 100644 --- a/jerry-core/ecma/operations/ecma-regexp-object.h +++ b/jerry-core/ecma/operations/ecma-regexp-object.h @@ -164,10 +164,7 @@ typedef struct ecma_value_t iterated_string; /**< [[IteratedString]] internal slot */ } ecma_regexp_string_iterator_t; -#if JERRY_ESNEXT lit_code_point_t ecma_regexp_unicode_advance (const lit_utf8_byte_t **str_p, const lit_utf8_byte_t *end_p); -#endif /* JERRY_ESNEXT */ - ecma_object_t *ecma_op_regexp_alloc (ecma_object_t *new_target_obj_p); ecma_value_t ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, ecma_string_t *input_string_p); ecma_string_t *ecma_regexp_read_pattern_str_helper (ecma_value_t pattern_arg); diff --git a/jerry-core/ecma/operations/ecma-string-object.c b/jerry-core/ecma/operations/ecma-string-object.c index 72f7f3aa..597d1868 100644 --- a/jerry-core/ecma/operations/ecma-string-object.c +++ b/jerry-core/ecma/operations/ecma-string-object.c @@ -70,7 +70,7 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of proto_id = ECMA_BUILTIN_ID_OBJECT_PROTOTYPE; #endif /* JERRY_BUILTIN_STRING */ ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id); -#if JERRY_ESNEXT + ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p); if (new_target) { @@ -80,7 +80,7 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of return ECMA_VALUE_ERROR; } } -#endif /* JERRY_ESNEXT */ + ecma_object_t *object_p = ecma_create_object (prototype_obj_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS); @@ -88,12 +88,11 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_STRING; ext_object_p->u.cls.u3.value = prim_value; -#if JERRY_ESNEXT if (new_target) { ecma_deref_object (prototype_obj_p); } -#endif /* JERRY_ESNEXT */ + return ecma_make_object_value (object_p); } /* ecma_op_create_string_object */ diff --git a/jerry-core/ecma/operations/ecma-symbol-object.c b/jerry-core/ecma/operations/ecma-symbol-object.c index 99d62562..adf84367 100644 --- a/jerry-core/ecma/operations/ecma-symbol-object.c +++ b/jerry-core/ecma/operations/ecma-symbol-object.c @@ -26,8 +26,6 @@ #include "lit-char-helpers.h" -#if JERRY_ESNEXT - /** \addtogroup ecma ECMA * @{ * @@ -172,7 +170,6 @@ ecma_symbol_this_value (ecma_value_t this_arg) /**< this argument value */ /* 3. */ return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_SYMBOL); } /* ecma_symbol_this_value */ -#endif /* JERRY_ESNEXT */ /** * @} diff --git a/jerry-core/ecma/operations/ecma-symbol-object.h b/jerry-core/ecma/operations/ecma-symbol-object.h index 1ca59930..4f27e02a 100644 --- a/jerry-core/ecma/operations/ecma-symbol-object.h +++ b/jerry-core/ecma/operations/ecma-symbol-object.h @@ -18,8 +18,6 @@ #include "ecma-globals.h" -#if JERRY_ESNEXT - /** \addtogroup ecma ECMA * @{ * @@ -39,7 +37,6 @@ ecma_value_t ecma_symbol_this_value (ecma_value_t this_arg); ecma_value_t ecma_get_symbol_descriptive_string (ecma_value_t symbol_value); -#endif /* JERRY_ESNEXT */ /** * @} * @} |