• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright JS Foundation and other contributors, http://js.foundation
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /*
17  * Number built-in description
18  */
19 
20 #include "ecma-builtin-helpers-macro-defines.inc.h"
21 
22 #if ENABLED (JERRY_BUILTIN_NUMBER)
23 
24 /* Number properties:
25  *  (property name, number value, writable, enumerable, configurable) */
26 
27 NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
28               1,
29               ECMA_PROPERTY_FLAG_DEFAULT_LENGTH)
30 
31 /* ECMA-262 v5, 15.7.3.4 */
32 NUMBER_VALUE (LIT_MAGIC_STRING_NAN,
33               ECMA_BUILTIN_NUMBER_NAN,
34               ECMA_PROPERTY_FIXED)
35 
36 /* ECMA-262 v5, 15.7.3.2 */
37 NUMBER_VALUE (LIT_MAGIC_STRING_MAX_VALUE_U,
38               ECMA_BUILTIN_NUMBER_MAX,
39               ECMA_PROPERTY_FIXED)
40 
41 /* ECMA-262 v5, 15.7.3.3 */
42 NUMBER_VALUE (LIT_MAGIC_STRING_MIN_VALUE_U,
43               ECMA_BUILTIN_NUMBER_MIN,
44               ECMA_PROPERTY_FIXED)
45 
46 /* ECMA-262 v5, 15.7.3.5 */
47 NUMBER_VALUE (LIT_MAGIC_STRING_POSITIVE_INFINITY_U,
48               ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY,
49               ECMA_PROPERTY_FIXED)
50 
51 /* ECMA-262 v5, 15.7.3.6 */
52 NUMBER_VALUE (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U,
53               ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY,
54               ECMA_PROPERTY_FIXED)
55 
56 #if ENABLED (JERRY_ES2015)
57 
58 /* ECMA-262 v6, 20.1.2.1 */
59 NUMBER_VALUE (LIT_MAGIC_STRING_EPSILON_U,
60               ECMA_BUILTIN_NUMBER_EPSILON,
61               ECMA_PROPERTY_FIXED)
62 
63 /* ECMA-262 v6, 20.1.2.6 */
64 NUMBER_VALUE (LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U,
65               ECMA_BUILTIN_NUMBER_MAX_SAFE_INTEGER,
66               ECMA_PROPERTY_FIXED)
67 
68 /* ECMA-262 v6, 20.1.2.8 */
69 NUMBER_VALUE (LIT_MAGIC_STRING_MIN_SAFE_INTEGER_U,
70               ECMA_BUILTIN_NUMBER_MIN_SAFE_INTEGER,
71               ECMA_PROPERTY_FIXED)
72 
73 #endif /* ENABLED (JERRY_ES2015) */
74 
75 /* Object properties:
76  *  (property name, object pointer getter) */
77 
78 /* ECMA-262 v5, 15.7.3.1 */
79 OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
80               ECMA_BUILTIN_ID_NUMBER_PROTOTYPE,
81               ECMA_PROPERTY_FIXED)
82 
83 #endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
84 
85 /* Routine properties:
86  *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
87 #if ENABLED (JERRY_ES2015)
88 ROUTINE (LIT_MAGIC_STRING_IS_FINITE, ecma_builtin_number_object_is_finite, 1, 1)
89 ROUTINE (LIT_MAGIC_STRING_IS_NAN, ecma_builtin_number_object_is_nan, 1, 1)
90 ROUTINE (LIT_MAGIC_STRING_IS_INTEGER, ecma_builtin_number_object_is_integer, 1, 1)
91 ROUTINE (LIT_MAGIC_STRING_IS_SAFE_INTEGER, ecma_builtin_number_object_is_safe_integer, 1, 1)
92 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_FLOAT, LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
93 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_PARSE_INT, LIT_MAGIC_STRING_PARSE_INT, ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
94 #endif /* ENABLED (JERRY_ES2015) */
95 #include "ecma-builtin-helpers-macro-undefs.inc.h"
96